Package jmri.jmrit.display.layoutEditor
Class LayoutEditorViewContext
- java.lang.Object
-
- jmri.jmrit.display.layoutEditor.LayoutEditorViewContext
-
public final class LayoutEditorViewContext extends java.lang.Object
LayoutEditorViewContext is a memo object containing the graphical View context information for aLayoutEditor
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 Constructor Description LayoutEditorViewContext()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getGridSize()
Get the width drawing the grid; 10 is the default/initial value.int
getGridSize2nd()
Get the width for 2nd drawing of the grid; 10 is the default/initial value.int
getLayoutHeight()
int
getLayoutWidth()
int
getMainlineBlockWidth()
Get the width for drawing mainline Block; 4 is the default/initial value.int
getMainlineTrackWidth()
Get the width for drawing mainline track; 4 is the default/initial value.int
getSidelineBlockWidth()
Get the width for drawing sideline Block; 2 is the default/initial value.int
getSidelineTrackWidth()
Get the width for drawing sideline track; 2 is the default/initial value.int
getUpperLeftX()
int
getUpperLeftY()
int
getWindowHeight()
int
getWindowWidth()
double
getXScale()
Get the X-axis scaling value; 1.0 is the default/initial value.double
getYScale()
Get the Y-axis scaling value; 1.0 is the default/initial value.int
setGridSize(int newSize)
int
setGridSize2nd(int newSize)
void
setLayoutHeight(int height)
void
setLayoutWidth(int width)
void
setMainlineBlockWidth(float width)
void
setMainlineTrackWidth(float width)
void
setSidelineBlockWidth(float width)
Set the width for sideline Block; note that the stored and retrievable value is an integer.void
setSidelineTrackWidth(float width)
Set the width for sideline track; note that the stored and retrievable value is an integer.void
setUpperLeftX(int x)
void
setUpperLeftY(int y)
void
setWindowHeight(int height)
void
setWindowWidth(int width)
void
setXScale(double scale)
void
setYScale(double scale)
-
-
-
Constructor Detail
-
LayoutEditorViewContext
LayoutEditorViewContext()
-
-
Method Detail
-
setLayoutWidth
public final void setLayoutWidth(int width)
-
getLayoutWidth
public final int getLayoutWidth()
-
setLayoutHeight
public final void setLayoutHeight(int height)
-
getLayoutHeight
public final int getLayoutHeight()
-
setWindowWidth
public final void setWindowWidth(int width)
-
getWindowWidth
public final int getWindowWidth()
-
setWindowHeight
public final void setWindowHeight(int height)
-
getWindowHeight
public final int getWindowHeight()
-
getUpperLeftX
public final int getUpperLeftX()
-
setUpperLeftX
public final void setUpperLeftX(int x)
-
getUpperLeftY
public final int getUpperLeftY()
-
setUpperLeftY
public final void setUpperLeftY(int y)
-
setGridSize
public final int setGridSize(int newSize)
-
getGridSize
public final int getGridSize()
Get the width drawing the grid; 10 is the default/initial value.- Returns:
- current value
-
setGridSize2nd
public final int setGridSize2nd(int newSize)
-
getGridSize2nd
public final int getGridSize2nd()
Get the width for 2nd drawing of the grid; 10 is the default/initial value.- Returns:
- current value
-
setMainlineTrackWidth
public final void setMainlineTrackWidth(float width)
-
getMainlineTrackWidth
public final int getMainlineTrackWidth()
Get the width for drawing mainline track; 4 is the default/initial value.- Returns:
- current value
-
setSidelineTrackWidth
public final void setSidelineTrackWidth(float width)
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
public final int getSidelineTrackWidth()
Get the width for drawing sideline track; 2 is the default/initial value.- Returns:
- current value
-
setMainlineBlockWidth
public final void setMainlineBlockWidth(float width)
-
getMainlineBlockWidth
public final int getMainlineBlockWidth()
Get the width for drawing mainline Block; 4 is the default/initial value.- Returns:
- current value
-
setSidelineBlockWidth
public final void setSidelineBlockWidth(float width)
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
public final int getSidelineBlockWidth()
Get the width for drawing sideline Block; 2 is the default/initial value.- Returns:
- current value
-
getXScale
public final double getXScale()
Get the X-axis scaling value; 1.0 is the default/initial value.- Returns:
- current value
-
setXScale
public final void setXScale(double scale)
-
getYScale
public final double getYScale()
Get the Y-axis scaling value; 1.0 is the default/initial value.- Returns:
- current value
-
setYScale
public final void setYScale(double scale)
-
-