|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.swt.widgets.Widget
org.eclipse.swt.widgets.Control
org.eclipse.swt.widgets.Scrollable
org.eclipse.swt.widgets.Composite
org.eclipse.swt.widgets.Canvas
org.eclipse.ohf.stem.ui.views.map.MapCanvas
public class MapCanvas
MapCanvas is a subclass of Canvas suitable for map drawings, It has some additional properties, such as access to the colors of the polygons and background. It also contains a PaintListener which will make the canvas draw itself whenever a change is done in the graphics. It also contains the "draw" method which gets the MapCanvas' list of polygons and puts them, using another adapter class (Graphics2DRenderer), on the MapCanvas.
Field Summary | |
---|---|
static java.lang.String |
DEFAULT_BACKGROUND_COLOR_STRING
The default background color string. |
static java.lang.String |
DEFAULT_BORDER_COLOR_STRING
The default border color string. |
static boolean |
DEFAULT_DRAW_POLYGON_BORDERS
The default value for drawing polygon borders. |
static double |
DEFAULT_GAIN_FACTOR
The default value for the initial gain factor. |
static double |
DEFAULT_GUI_SCALING_FACTOR
This is the default scaling factor |
static int |
DEFAULT_INITIAL_X_TRANSLATION
The default value for the intial translation of the map in the x-axis |
static int |
DEFAULT_INITIAL_Y_TRANSLATION
The default value for the intial translation of the map in the y-axis |
static boolean |
DEFAULT_LOGSCALE
The default value for displaying with a logrithmic scale. |
static java.lang.String |
DEFAULT_POLYGON_COLOR_RELATIVE_VALUE_ZERO_STRING
The default polygon color string. |
static java.lang.String |
DEFAULT_POLYGON_COLOR_STRING
The default polygon color string. |
static double |
DEFAULT_SCALING_FACTOR_ON_ZOOM_RULER
The default value for the zoom factor of the displays scale |
Fields inherited from class org.eclipse.swt.widgets.Control |
---|
handle |
Constructor Summary | |
---|---|
MapCanvas(org.eclipse.swt.widgets.Composite parent,
int style)
Constructor. |
Method Summary | |
---|---|
void |
dispose()
Disposes the Color objects |
void |
draw(org.eclipse.swt.graphics.GC gc,
int x,
int y,
int width,
int height)
The method which gets the MapCanvas' polygons list, and draws it on the MapCanvas. |
java.awt.geom.AffineTransform |
getAffineTransform()
|
java.awt.Color |
getBackgroundColorAWT()
Gets the background color of the MapCanvas (in AWT). |
org.eclipse.swt.graphics.RGB |
getBackgroundColorRGB()
|
org.eclipse.swt.graphics.Color |
getBackgroundColorSWT()
|
java.awt.Color |
getBorderColorAWT()
Gets the border color (in AWT). |
org.eclipse.swt.graphics.Color |
getBorderColorSWT()
Gets the polygons base color of the MapCanvas (in SWT). |
double |
getDataScalingFactorInXaxis()
|
double |
getDataScalingFactorInYaxis()
|
boolean |
getDrawPolygonsBorders()
Determins whether the polygons borders will be drawn. |
org.eclipse.swt.graphics.Color |
getForegroundColorSWT()
|
double |
getGainFactor()
Gets the gain factor for the displayed colors |
double |
getGuiScalingFactorInXaxis()
|
double |
getGuiScalingFactorInYaxis()
|
StemPolygonsList |
getPolygons()
|
java.awt.Color |
getPolygonsColorAWT()
Gets the polygons base color of the MapCanvas (in AWT). |
java.awt.Color |
getPolygonsColorRelativeValueZeroAWT()
Gets the polygons base color of the MapCanvas (in AWT) when the relative value is zero. |
org.eclipse.swt.graphics.RGB |
getPolygonsColorRelativeValueZeroRGB()
|
org.eclipse.swt.graphics.Color |
getPolygonsColorRelativeValueZeroSWT()
|
org.eclipse.swt.graphics.RGB |
getPolygonsColorRGB()
Gets the polygons base color of the MapCanvas (in RGB). |
org.eclipse.swt.graphics.Color |
getPolygonsColorSWT()
Gets the polygons base color of the MapCanvas (in SWT). |
double |
getScalingFactorInYaxis()
|
double |
getScalingFactorOnZoomRuler()
Get the scaling factor which was saved in the zoom scale in the view. |
double |
getTranslateX()
|
double |
getTranslateY()
|
java.lang.String |
getWhichProjection()
|
double |
getZoomFactorInXaxis()
Gets the scaling factor of the map (zoom in/out). |
double |
getZoomFactorInYaxis()
Gets the scaling factor of the map (zoom in/out). |
float |
multiplyByGainFactor(float val)
Multiplies the relative value which is going to be displayed by the gain factor required by the user. |
float |
performLogScaling(float v)
Perform a log scale to a specific value |
void |
produceIntCoordinates()
Performs the projection on the MapCanvas' polygons list. |
void |
setAffineTransform(java.awt.geom.AffineTransform affineTransform)
Set the affine transform |
void |
setBackgroundColorRGB(org.eclipse.swt.graphics.RGB bgRGB)
Sets the background color. |
void |
setBorderColorRGB(org.eclipse.swt.graphics.RGB borderRGB)
Sets the polygons base color of the polygons. |
void |
setDataScalingFactorInXaxis(double dataScalingFactorInXaxis)
Set the X axis data scaling factor |
void |
setDataScalingFactorInYaxis(double dataScalingFactorInYaxis)
Set the Y axis data scaling factor |
void |
setDrawPolygonBorders(boolean drawBordersFlag)
Determins whether the polygons borders will be drawn. |
void |
setGainFactor(double gainVal)
Sets the gain factor for the displayed colors |
void |
setGuiScalingFactorInXaxis(double scalingFactorInXaxis)
Set the X axis scaling factor |
void |
setGuiScalingFactorInYaxis(double guiScalingFactorInYaxis)
Set the Y axis Gui scaling factor |
void |
setPolygons(StemPolygonsList polygonsList)
Sets the polygons list of the MapCanvas. |
void |
setPolygonsCentersConnections(StemPolygonsList polygonsCentersConnectionsList)
Sets the polygons that connects the nodes |
void |
setPolygonsColorRelativeValueZeroRGB(org.eclipse.swt.graphics.RGB polygonsColorRelativeValueZeroRGB)
|
void |
setPolygonsColorRelativeValueZeroSWT(org.eclipse.swt.graphics.Color polygonsColorRelativeValueZeroSWT)
|
void |
setPolygonsColorRGB(org.eclipse.swt.graphics.RGB polyRGB)
Sets the polygons base color of the polygons. |
void |
setScalingFactorInYaxis(double scalingFactorInYaxis)
Set the Y axis scaling factor |
void |
setScalingFactorOnZoomRuler(double val)
Sets the scaling factor (the one that appears on the zoom ruler). |
void |
setTranslate(double valX,
double valY)
Sets the offset needed for the coordinates in order to draw the map on the canvas. |
void |
setWhichProjection(java.lang.String whichProjection)
|
void |
toggleDisplayPolygonsNames()
Switch the option of displaying the polygons titles. |
void |
toggleDrawPolygonsBordersChoice()
Switch the option of drawing the borders of polygons on the map. |
void |
toggleDrawPolygonsCentersConnections()
Switch the option of drawing the edges connecting every two polygons. |
void |
toggleLogScaleChoice()
Switch the option of displaying the polygons titles. |
void |
zoom(double zoomX,
double zoomY)
Sets the scaling factor of the map (zoom in/out). |
Methods inherited from class org.eclipse.swt.widgets.Canvas |
---|
drawBackground, getCaret, scroll, setCaret, setFont |
Methods inherited from class org.eclipse.swt.widgets.Composite |
---|
changed, computeSize, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList |
Methods inherited from class org.eclipse.swt.widgets.Scrollable |
---|
computeTrim, getClientArea, getHorizontalBar, getVerticalBar |
Methods inherited from class org.eclipse.swt.widgets.Control |
---|
addControlListener, addDragDetectListener, addFocusListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTraverseListener, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getParent, getShell, getSize, getToolTipText, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTraverseListener, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setForeground, setLayoutData, setLocation, setLocation, setMenu, setParent, setRedraw, setSize, setSize, setToolTipText, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, update |
Methods inherited from class org.eclipse.swt.widgets.Widget |
---|
addDisposeListener, addListener, getData, getData, getDisplay, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, setData, setData, toString |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String DEFAULT_BACKGROUND_COLOR_STRING
public static final java.lang.String DEFAULT_POLYGON_COLOR_STRING
public static final java.lang.String DEFAULT_POLYGON_COLOR_RELATIVE_VALUE_ZERO_STRING
public static final java.lang.String DEFAULT_BORDER_COLOR_STRING
public static final double DEFAULT_GUI_SCALING_FACTOR
public static final int DEFAULT_INITIAL_X_TRANSLATION
public static final int DEFAULT_INITIAL_Y_TRANSLATION
public static final double DEFAULT_GAIN_FACTOR
setGainFactor(double)
,
Constant Field Valuespublic static final boolean DEFAULT_DRAW_POLYGON_BORDERS
true
toggleDisplayPolygonsNames()
,
Constant Field Valuespublic static final boolean DEFAULT_LOGSCALE
false
toggleLogScaleChoice()
,
Constant Field Valuespublic static final double DEFAULT_SCALING_FACTOR_ON_ZOOM_RULER
setScalingFactorOnZoomRuler(double)
,
Constant Field ValuesConstructor Detail |
---|
public MapCanvas(org.eclipse.swt.widgets.Composite parent, int style)
parent
- style
- Method Detail |
---|
public void setPolygons(StemPolygonsList polygonsList)
polygonsList
- public StemPolygonsList getPolygons()
public void setPolygonsCentersConnections(StemPolygonsList polygonsCentersConnectionsList)
polygonsCentersConnectionsList
- public void setBackgroundColorRGB(org.eclipse.swt.graphics.RGB bgRGB)
bgRGB
- public org.eclipse.swt.graphics.RGB getBackgroundColorRGB()
public org.eclipse.swt.graphics.Color getBackgroundColorSWT()
public org.eclipse.swt.graphics.Color getForegroundColorSWT()
public java.awt.Color getBackgroundColorAWT()
public void setPolygonsColorRGB(org.eclipse.swt.graphics.RGB polyRGB)
polyRGB
- public void setBorderColorRGB(org.eclipse.swt.graphics.RGB borderRGB)
borderRGB
- public org.eclipse.swt.graphics.RGB getPolygonsColorRGB()
public org.eclipse.swt.graphics.Color getPolygonsColorSWT()
public org.eclipse.swt.graphics.Color getBorderColorSWT()
public java.awt.Color getPolygonsColorAWT()
public java.awt.Color getPolygonsColorRelativeValueZeroAWT()
public java.awt.Color getBorderColorAWT()
public double getGuiScalingFactorInXaxis()
public void setGuiScalingFactorInXaxis(double scalingFactorInXaxis)
scalingFactorInXaxis
- public double getScalingFactorInYaxis()
public void setScalingFactorInYaxis(double scalingFactorInYaxis)
scalingFactorInYaxis
- public void zoom(double zoomX, double zoomY)
zoomX
- zoomY
- public double getZoomFactorInXaxis()
public double getZoomFactorInYaxis()
public double getScalingFactorOnZoomRuler()
public void setScalingFactorOnZoomRuler(double val)
val
- public void setDrawPolygonBorders(boolean drawBordersFlag)
drawBordersFlag
- public boolean getDrawPolygonsBorders()
public void setGainFactor(double gainVal)
gainVal
- public double getGainFactor()
public void toggleDrawPolygonsBordersChoice()
public void toggleLogScaleChoice()
public void toggleDisplayPolygonsNames()
public void toggleDrawPolygonsCentersConnections()
public void draw(org.eclipse.swt.graphics.GC gc, int x, int y, int width, int height)
gc
- x
- y
- width
- height
- public float performLogScaling(float v)
v
-
public float multiplyByGainFactor(float val)
val
-
public void produceIntCoordinates()
public void setTranslate(double valX, double valY)
valX
- valY
- public double getTranslateX()
public double getTranslateY()
public void dispose()
dispose
in class org.eclipse.swt.widgets.Widget
public java.awt.geom.AffineTransform getAffineTransform()
public void setAffineTransform(java.awt.geom.AffineTransform affineTransform)
affineTransform
- public java.lang.String getWhichProjection()
public void setWhichProjection(java.lang.String whichProjection)
whichProjection
- public double getDataScalingFactorInXaxis()
public void setDataScalingFactorInXaxis(double dataScalingFactorInXaxis)
dataScalingFactorInXaxis
- public double getDataScalingFactorInYaxis()
public void setDataScalingFactorInYaxis(double dataScalingFactorInYaxis)
dataScalingFactorInYaxis
- public double getGuiScalingFactorInYaxis()
public void setGuiScalingFactorInYaxis(double guiScalingFactorInYaxis)
guiScalingFactorInYaxis
- public org.eclipse.swt.graphics.RGB getPolygonsColorRelativeValueZeroRGB()
public void setPolygonsColorRelativeValueZeroRGB(org.eclipse.swt.graphics.RGB polygonsColorRelativeValueZeroRGB)
polygonsColorRelativeValueZeroRGB
- public org.eclipse.swt.graphics.Color getPolygonsColorRelativeValueZeroSWT()
public void setPolygonsColorRelativeValueZeroSWT(org.eclipse.swt.graphics.Color polygonsColorRelativeValueZeroSWT)
polygonsColorRelativeValueZeroSWT
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |