Package jmri.jmrit.display.layoutEditor
Class LayoutEditorViewContext
java.lang.Object
jmri.jmrit.display.layoutEditor.LayoutEditorViewContext
LayoutEditorViewContext is a memo object containing
the graphical View context information for a
LayoutEditor MVC instance.
As a memo class, this may contain methods, but the class cannot include references to other classes, and ideally the methods won't use references to other classes. Just data, and operations on that data.
This should map to a subset of the variables stored and loaded by
LayoutEditorXml
and the XML Schema for the LayoutEditor element.
This holds graphical View context information. It should not include Model (e.g. layout hardware, even global values) or Control (e.g. options affecting the operation of the editor) information.
It's OK for this to hold startup default values for the quantities.
This may be a temporary class, only existing to help build a better structure into this package.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal intGet the width drawing the grid; 10 is the default/initial value.final intGet the width for 2nd drawing of the grid; 10 is the default/initial value.final intfinal intfinal intGet the width for drawing mainline Block; 4 is the default/initial value.final intGet the width for drawing mainline track; 4 is the default/initial value.final intGet the width for drawing sideline Block; 2 is the default/initial value.final intGet the width for drawing sideline track; 2 is the default/initial value.final intfinal intfinal intfinal intfinal doubleGet the X-axis scaling value; 1.0 is the default/initial value.final doubleGet the Y-axis scaling value; 1.0 is the default/initial value.final intsetGridSize(int newSize) final intsetGridSize2nd(int newSize) final voidsetLayoutHeight(int height) final voidsetLayoutWidth(int width) final voidsetMainlineBlockWidth(float width) final voidsetMainlineTrackWidth(float width) final voidsetSidelineBlockWidth(float width) Set the width for sideline Block; note that the stored and retrievable value is an integer.final voidsetSidelineTrackWidth(float width) Set the width for sideline track; note that the stored and retrievable value is an integer.final voidsetUpperLeftX(int x) final voidsetUpperLeftY(int y) final voidsetWindowHeight(int height) final voidsetWindowWidth(int width) final voidsetXScale(double scale) final voidsetYScale(double scale)
-
Constructor Details
-
LayoutEditorViewContext
-
-
Method Details
-
setLayoutWidth
-
getLayoutWidth
-
setLayoutHeight
-
getLayoutHeight
-
setWindowWidth
-
getWindowWidth
-
setWindowHeight
-
getWindowHeight
-
getUpperLeftX
-
setUpperLeftX
-
getUpperLeftY
-
setUpperLeftY
-
setGridSize
-
getGridSize
Get the width drawing the grid; 10 is the default/initial value.- Returns:
- current value
-
setGridSize2nd
-
getGridSize2nd
Get the width for 2nd drawing of the grid; 10 is the default/initial value.- Returns:
- current value
-
setMainlineTrackWidth
-
getMainlineTrackWidth
Get the width for drawing mainline track; 4 is the default/initial value.- Returns:
- current value
-
setSidelineTrackWidth
Set the width for sideline track; note that the stored and retrievable value is an integer.- Parameters:
width- Value to store; will be cast to (int)
-
getSidelineTrackWidth
Get the width for drawing sideline track; 2 is the default/initial value.- Returns:
- current value
-
setMainlineBlockWidth
-
getMainlineBlockWidth
Get the width for drawing mainline Block; 4 is the default/initial value.- Returns:
- current value
-
setSidelineBlockWidth
Set the width for sideline Block; note that the stored and retrievable value is an integer.- Parameters:
width- Value to store; will be cast to (int)
-
getSidelineBlockWidth
Get the width for drawing sideline Block; 2 is the default/initial value.- Returns:
- current value
-
getXScale
Get the X-axis scaling value; 1.0 is the default/initial value.- Returns:
- current value
-
setXScale
-
getYScale
Get the Y-axis scaling value; 1.0 is the default/initial value.- Returns:
- current value
-
setYScale
-