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 aLayoutEditorMVC 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
LayoutEditorXmland 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 intgetGridSize()Get the width drawing the grid; 10 is the default/initial value.intgetGridSize2nd()Get the width for 2nd drawing of the grid; 10 is the default/initial value.intgetLayoutHeight()intgetLayoutWidth()intgetMainlineBlockWidth()Get the width for drawing mainline Block; 4 is the default/initial value.intgetMainlineTrackWidth()Get the width for drawing mainline track; 4 is the default/initial value.intgetSidelineBlockWidth()Get the width for drawing sideline Block; 2 is the default/initial value.intgetSidelineTrackWidth()Get the width for drawing sideline track; 2 is the default/initial value.intgetUpperLeftX()intgetUpperLeftY()intgetWindowHeight()intgetWindowWidth()doublegetXScale()Get the X-axis scaling value; 1.0 is the default/initial value.doublegetYScale()Get the Y-axis scaling value; 1.0 is the default/initial value.intsetGridSize(int newSize)intsetGridSize2nd(int newSize)voidsetLayoutHeight(int height)voidsetLayoutWidth(int width)voidsetMainlineBlockWidth(float width)voidsetMainlineTrackWidth(float width)voidsetSidelineBlockWidth(float width)Set the width for sideline Block; note that the stored and retrievable value is an integer.voidsetSidelineTrackWidth(float width)Set the width for sideline track; note that the stored and retrievable value is an integer.voidsetUpperLeftX(int x)voidsetUpperLeftY(int y)voidsetWindowHeight(int height)voidsetWindowWidth(int width)voidsetXScale(double scale)voidsetYScale(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)
-
-