Commit 6b67c74f authored by Martin Eisenmann's avatar Martin Eisenmann
Browse files

YELLOW

Issue-Ref: 4016
Issue-Url: https://af3-developer.fortiss.org/issues/4016

Signed-off-by: Martin Eisenmann's avatarMartin Eisenmann <eisenmann@fortiss.org>
parent 8a54603e
......@@ -17,14 +17,14 @@
<GridPane fx:id="mainPane" prefHeight="600.0" prefWidth="1000.0" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="768.0" minWidth="10.0" percentWidth="37.0" prefWidth="451.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="462.0" minWidth="10.0" percentWidth="63.0" prefWidth="397.0" />
<ColumnConstraints hgrow="NEVER" prefWidth="275.0" />
<ColumnConstraints hgrow="ALWAYS" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<VBox>
<VBox minWidth="275.0">
<children>
<Region prefHeight="200.0" prefWidth="200.0" VBox.vgrow="ALWAYS" />
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="Scale" wrappingWidth="311.677734375">
......@@ -32,7 +32,7 @@
<Font size="15.0" />
</font>
</Text>
<Slider id="slider" fx:id="slider" blockIncrement="1.0" majorTickUnit="1.0" max="10.0" min="1.0" minorTickCount="1" showTickMarks="true" snapToTicks="true" value="1.0" />
<Slider id="slider" fx:id="slider" blockIncrement="1.0" majorTickUnit="1.0" max="10.0" min="1.0" minorTickCount="1" prefWidth="857.0" showTickMarks="true" snapToTicks="true" value="1.0" />
<Region prefHeight="200.0" prefWidth="200.0" VBox.vgrow="ALWAYS" />
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="Number of periods to display" wrappingWidth="311.677734375">
<font>
......
......@@ -2,9 +2,9 @@ AbstractObjectToDrawFX.java 81b5892711f72c44f775b01b87260b89c685e77b YELLOW
LabelToDrawFX.java 583cb93083db0ee96a94c5358858d35f0f9c5946 YELLOW
LineToDrawFX.java 79e2fe830196fb2a301b47aca668e27cdf4f3abc YELLOW
ScheduleModelElementToDrawFX.java 7863a2dafd0f1e3f8595fda035cb4ed31758224a YELLOW
ScheduleViewCanvasFX.java 6aa5eb04629fc17ee4318fbe0221f6a7c88cc0e6 YELLOW
ScheduleViewCanvasFX.java cc83a8d9888c8e02089f496134f5d7b55105a540 YELLOW
ScheduleViewColorsFX.java 1574aa027bd79b4f1f496e4c34413e77d45d9134 YELLOW
ScheduleViewCompositeFX.java 6599300349d3d42cb60fe006b053ac3d8e4c12b0 YELLOW
ScheduleViewCompositeFX.java 228c207869a336f72cbfd6ca2d6c70cf07a1b3f5 YELLOW
ScheduleViewFX.java 37b3ce2c899bb4cc7a04dbb5204320a8d50a8cd0 YELLOW
ScheduleViewGraphModelFX.java 49b7d919b5ec3de67b683c74b8763c0b127f4b04 YELLOW
ScheduleViewLayoutDataFX.java 35401925ec4f1421998c2e269f7fda9df3133666 YELLOW
......
......@@ -388,7 +388,7 @@ public class ScheduleViewCanvasFX {
int offsetY) {
gc.beginPath();
for(BigDecimal period : periods) {
gc.setFill(color);
gc.setStroke(color);
int diagramPeriodX = scheduleLayoutData.objectSpaceToDiagramSpaceX(period
.add(BigDecimal.valueOf(round).multiply(scheduleModel.getScheduleLength())));
......
......@@ -396,6 +396,7 @@ public class ScheduleViewCompositeFX extends CompositeFXControllerBase<Node, Nod
isSelectionChangedEnabled = true;
setSchedule(scheduleContainer, scheduleList, majorFrame);
updateTitle();
redrawCanvas();
}
/** Updates the {@link ScheduleViewFX}'s title. */
......@@ -422,18 +423,31 @@ public class ScheduleViewCompositeFX extends CompositeFXControllerBase<Node, Nod
}
}
/** Issues a redraw of {@link #canvasWrapper}. */
public void redrawCanvas() {
canvasWrapper.repaint();
BigDecimal majorFrame = canvasWrapper.getScheduleModel().getMajorFrame();
boolean hasPeriods = majorFrame != null && majorFrame.compareTo(ZERO) != 0;
displayPeriodsSchedulableEntitiesCheckBox.setDisable(!hasPeriods);
displayPeriodsSchedulesCheckBox.setDisable(!hasPeriods);
}
/**
* Callback for {@link #displayPeriodsSchedulesCheckBox}
*/
public void onActionDisplayPeriods() {
canvasWrapper.setDisplayPeriodsSchedules(displayPeriodsSchedulesCheckBox.isPressed());
canvasWrapper.setDisplayPeriodsSchedules(displayPeriodsSchedulesCheckBox.isSelected());
redrawCanvas();
}
/**
* Callback for {@link #displayPeriodsSchedulableEntitiesCheckBox}
*/
public void onActionDisplayPeriodsSchedulable() {
canvasWrapper.setDisplayPeriodsSchedules(displayPeriodsSchedulableEntitiesCheckBox.isPressed());
canvasWrapper.setDisplayPeriodsSchedulableEntities(
displayPeriodsSchedulableEntitiesCheckBox.isSelected());
redrawCanvas();
}
/**
......
ScheduleUIUtils.java d7f6d8eb4be6f8fd934f913257ffc165073e2333 GREEN
ScheduleUIUtils.java 8bd742f69919045fa341a4a5d9479e108393f85c YELLOW
ScheduleViewUtils.java b9c8c98333975569543c56ddc7e93ee4de31b921 GREEN
ScheduleViewUtilsFX.java 1ef21ec7bc4176d37393f07a6b756400520cb295 YELLOW
......@@ -35,9 +35,9 @@ import javafx.scene.text.Font;
import javafx.scene.text.Text;
/**
* Useful methods for Scheduling View
* Useful methods for Scheduling View FX
*
* @author SVoss
* @author eisenmann
*/
public class ScheduleViewUtilsFX {
/**
......@@ -61,6 +61,9 @@ public class ScheduleViewUtilsFX {
return text.substring(0, sum);
}
/**
* Calculates the dimensions of a given string
*/
private static Bounds textWidth(GraphicsContext gc, String textToMeasure) {
Text textField = new Text(textToMeasure);
textField.setFont(gc.getFont());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment