|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Component
java.awt.Canvas
org.jscience.architecture.traffic.View
public abstract class View
A View is a graphical representation of an infrastructure.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.awt.Canvas |
|---|
java.awt.Canvas.AccessibleAWTCanvas |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
protected java.awt.image.BufferedImage |
buffer
The back buffer |
protected int |
bufferMinimumOverflow
Number of pixels the buffer always overflows |
protected int |
bufferOverflow
Number of pixels added to viewport for buffer |
protected java.awt.Point |
bufferPosition
Position of the buffer in zoomed view coords |
protected java.awt.Dimension |
bufferSize
Size of the buffer in pixels |
protected java.awt.geom.AffineTransform |
bufferTransform
The transform used to transform coordinates from infra to buffer space |
protected java.awt.Dimension |
infraSize
Size of the infrastructure |
protected java.util.LinkedList |
overlays
List of all overlays |
protected java.awt.Point |
viewportPosition
Position of the viewport in zoomed view coords |
protected java.awt.Dimension |
viewportSize
Size of the viewport in pixels |
protected java.awt.Point |
viewPosition
Position of this view in the infrastructure in infra coords |
protected java.awt.Dimension |
viewSize
Size of this view in in pixels |
protected java.awt.geom.AffineTransform |
viewTransform
The transform used to transform coordinates from infra to view space |
protected float |
zoomFactor
The current zoom factor |
protected float[] |
zoomFactors
A list of all possible zoom factors |
protected int |
zoomIndex
The index of the current zoom factor into the zoom factor list |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
View()
Creates a new View object. |
|
View(java.awt.Dimension infras)
Creates a new View object. |
|
| Method Summary | |
|---|---|
void |
addOverlay(Overlay ol)
Adds an overlay to this view. |
protected abstract void |
fillBuffer(java.awt.Graphics2D g)
DOCUMENT ME! |
int |
getBufferOverflow()
DOCUMENT ME! |
java.awt.Point |
getBufferPosition()
DOCUMENT ME! |
java.awt.Dimension |
getBufferSize()
DOCUMENT ME! |
java.awt.Dimension |
getInfraSize()
DOCUMENT ME! |
java.awt.Dimension |
getPreferredSize()
Returns the preferred size of this view. |
java.awt.Point |
getViewportPosition()
DOCUMENT ME! |
java.awt.Dimension |
getViewportSize()
DOCUMENT ME! |
java.awt.Point |
getViewPosition()
DOCUMENT ME! |
java.awt.Dimension |
getViewSize()
DOCUMENT ME! |
java.lang.String |
getXMLName()
DOCUMENT ME! |
float |
getZoomFactor()
Returns the current zoom factor |
int |
getZoomIndex()
Returns the current zoom index |
void |
load(XMLElement myElement,
XMLLoader loader)
Load this XMLSerializable |
void |
paint(java.awt.Graphics gr)
DOCUMENT ME! |
protected void |
redraw()
DOCUMENT ME! |
void |
remOverlay(Overlay ol)
Removes an overlay from this view. |
void |
resizeInfra(java.awt.Dimension d)
Resizes the infrastructure |
void |
resizeViewport(java.awt.Dimension d)
Resizes the viewport to the given size |
void |
saveChilds(XMLSaver saver)
DOCUMENT ME! |
XMLElement |
saveSelf()
DOCUMENT ME! |
void |
scrollViewport(java.awt.Point p)
Scrolls the viewport to the specified view point |
void |
setBufferOverflow(int bo)
DOCUMENT ME! |
void |
setBufferPosition(java.awt.Point p)
DOCUMENT ME! |
void |
setBufferSize(java.awt.Dimension d)
DOCUMENT ME! |
void |
setInfraSize(java.awt.Dimension d)
DOCUMENT ME! |
void |
setParentName(java.lang.String parentName)
DOCUMENT ME! |
void |
setViewportPosition(java.awt.Point p)
DOCUMENT ME! |
void |
setViewportSize(java.awt.Dimension d)
DOCUMENT ME! |
void |
setViewPosition(java.awt.Point p)
DOCUMENT ME! |
void |
setViewSize(java.awt.Dimension d)
DOCUMENT ME! |
void |
setZoomFactor(float z)
Sets the current zoom factor |
void |
setZoomIndex(int i)
Sets the current zoom index |
java.awt.Point |
toInfra(java.awt.Point p)
Converts the given point from view to infrastructure coordinate space |
java.awt.Point |
toView(java.awt.Point p)
Converts the given point from infrastructure to view coordinate space |
void |
update(java.awt.Graphics g)
DOCUMENT ME! |
void |
update(java.util.Observable o,
java.lang.Object arg)
|
void |
zoomIn()
Increases the zoom factor |
void |
zoomOut()
Decreases the zoom factor. |
void |
zoomTo(int index)
Sets the zoom factor for this View. |
| Methods inherited from class java.awt.Canvas |
|---|
addNotify, createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy |
| Methods inherited from class java.awt.Component |
|---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected java.awt.image.BufferedImage buffer
protected java.awt.geom.AffineTransform bufferTransform
protected java.awt.geom.AffineTransform viewTransform
protected java.awt.Point viewPosition
protected java.awt.Point bufferPosition
protected java.awt.Point viewportPosition
protected java.awt.Dimension viewSize
protected java.awt.Dimension viewportSize
protected java.awt.Dimension bufferSize
protected java.awt.Dimension infraSize
protected int bufferOverflow
protected int bufferMinimumOverflow
protected float zoomFactor
protected final float[] zoomFactors
protected int zoomIndex
protected java.util.LinkedList overlays
| Constructor Detail |
|---|
public View(java.awt.Dimension infras)
infras - DOCUMENT ME!public View()
| Method Detail |
|---|
public float getZoomFactor()
public void setZoomFactor(float z)
z - DOCUMENT ME!public int getZoomIndex()
public void setZoomIndex(int i)
i - DOCUMENT ME!public java.awt.Point getViewPosition()
public void setViewPosition(java.awt.Point p)
p - DOCUMENT ME!public java.awt.Point getViewportPosition()
public void setViewportPosition(java.awt.Point p)
p - DOCUMENT ME!public java.awt.Point getBufferPosition()
public void setBufferPosition(java.awt.Point p)
p - DOCUMENT ME!public java.awt.Dimension getViewSize()
public void setViewSize(java.awt.Dimension d)
d - DOCUMENT ME!public java.awt.Dimension getViewportSize()
public void setViewportSize(java.awt.Dimension d)
d - DOCUMENT ME!public java.awt.Dimension getBufferSize()
public void setBufferSize(java.awt.Dimension d)
d - DOCUMENT ME!public java.awt.Dimension getInfraSize()
public void setInfraSize(java.awt.Dimension d)
d - DOCUMENT ME!public int getBufferOverflow()
public void setBufferOverflow(int bo)
bo - DOCUMENT ME!public void addOverlay(Overlay ol)
ol - The overlay to addpublic void remOverlay(Overlay ol)
ol - The overlay to remove.public void zoomIn()
public void zoomOut()
public void zoomTo(int index)
View.
index - The index of the new zoom factor.public void scrollViewport(java.awt.Point p)
p - The point in view coordinate space to scroll topublic void resizeViewport(java.awt.Dimension d)
d - DOCUMENT ME!public void resizeInfra(java.awt.Dimension d)
d - DOCUMENT ME!
public void update(java.util.Observable o,
java.lang.Object arg)
update in interface java.util.Observerprotected void redraw()
protected abstract void fillBuffer(java.awt.Graphics2D g)
g - DOCUMENT ME!public void update(java.awt.Graphics g)
update in class java.awt.Canvasg - DOCUMENT ME!public void paint(java.awt.Graphics gr)
paint in class java.awt.Canvasgr - DOCUMENT ME!public java.awt.Dimension getPreferredSize()
getPreferredSize in class java.awt.Component
public void load(XMLElement myElement,
XMLLoader loader)
throws XMLTreeException,
java.io.IOException,
XMLInvalidInputException
XMLSerializable
load in interface XMLSerializablemyElement - The XMLElement which represents this object in the XML
tree. It can contain attributes which hold information about the
object.loader - The XMLLoader which this XMLSerializable can use to load
child objects.
XMLTreeException - The parser can throw this exception if it is
called by the XMLSerializable. The XMLSerializable should NOT
throw this exception by itself and preferrably not catch it
too.
java.io.IOException - Thrown in case of an read error in the XML file.
XMLInvalidInputException - The XMLSerializable can throw this
exception if it cannot load itself or one of its child objects
for whatever reason.
public XMLElement saveSelf()
throws XMLCannotSaveException
saveSelf in interface XMLSerializableXMLCannotSaveException - DOCUMENT ME!
public void saveChilds(XMLSaver saver)
throws XMLTreeException,
java.io.IOException,
XMLCannotSaveException
saveChilds in interface XMLSerializablesaver - DOCUMENT ME!
XMLTreeException - DOCUMENT ME!
java.io.IOException - DOCUMENT ME!
XMLCannotSaveException - DOCUMENT ME!public java.lang.String getXMLName()
getXMLName in interface XMLSerializable
public void setParentName(java.lang.String parentName)
throws XMLTreeException
setParentName in interface XMLSerializableparentName - DOCUMENT ME!
XMLTreeException - DOCUMENT ME!public java.awt.Point toView(java.awt.Point p)
p - DOCUMENT ME!
public java.awt.Point toInfra(java.awt.Point p)
p - DOCUMENT ME!
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||