This repository has been archived by the owner on Dec 12, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
5 changed files
with
337 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
86 changes: 86 additions & 0 deletions
86
Plugin Gleisbelegung/src/com/gleisbelegung/plugin/Gleis.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
package com.gleisbelegung.plugin; | ||
|
||
import javafx.application.Platform; | ||
import java.util.ArrayList; | ||
|
||
public class Gleis extends Plugin_Gleisbelegung { | ||
private ArrayList<LabelContainer> spalte; | ||
private LabelContainer gleisLabel; | ||
private String gleisName; | ||
private boolean sichtbar; | ||
private boolean hervorgehoben; | ||
|
||
public Gleis(String gleisName){ | ||
this.gleisName = gleisName; | ||
this.sichtbar = true; | ||
|
||
hervorgehoben = false; | ||
} | ||
|
||
public ArrayList<LabelContainer> getSpalte() { | ||
return spalte; | ||
} | ||
public void setSpalte(ArrayList<LabelContainer> spalte) { | ||
this.spalte = spalte; | ||
} | ||
|
||
public String getGleisName() { | ||
return gleisName; | ||
} | ||
public void setGleisName(String gleisName) { | ||
this.gleisName = gleisName; | ||
} | ||
|
||
public boolean isSichtbar() { | ||
return sichtbar; | ||
} | ||
public void setSichtbar(boolean sichtbar) { | ||
this.sichtbar = sichtbar; | ||
} | ||
|
||
public LabelContainer getGleisLabel() { | ||
return gleisLabel; | ||
} | ||
public void setGleisLabel(LabelContainer gleisLabel) { | ||
gleisLabel.getLabel().setOnMouseClicked(e -> hebeHervor()); | ||
|
||
this.gleisLabel = gleisLabel; | ||
} | ||
|
||
public void setLabelContainerToWith(int width){ | ||
for(LabelContainer lc : spalte){ | ||
Platform.runLater(() -> { | ||
lc.getLabel().setMaxWidth(width); | ||
lc.getLabel().setPrefWidth(width); | ||
lc.getLabel().setMinWidth(width); | ||
}); | ||
} | ||
|
||
gleisLabel.getLabel().setMaxWidth(width); | ||
gleisLabel.getLabel().setPrefWidth(width); | ||
gleisLabel.getLabel().setMinWidth(width); | ||
} | ||
|
||
private void hebeHervor(){ | ||
if(hervorgehoben) { | ||
gleisLabel.getLabel().setStyle(gleisLabel.getLabel().getStyle() + "; -fx-background-color: #303030"); | ||
for(LabelContainer lc : spalte){ | ||
lc.setHervorhebungDurchGleis(false); | ||
} | ||
|
||
hervorgehoben = false; | ||
} | ||
else { | ||
gleisLabel.getLabel().setStyle(gleisLabel.getLabel().getStyle() + "; -fx-background-color: #181818"); | ||
|
||
for(LabelContainer lc : spalte){ | ||
lc.setHervorhebungDurchGleis(true); | ||
} | ||
|
||
hervorgehoben = true; | ||
} | ||
} | ||
public boolean getHebeHervor(){ | ||
return hervorgehoben; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.