svg
Class SVGPanel

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--svg.SVGPanel
All Implemented Interfaces:
DispletCommunication, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class SVGPanel
extends java.awt.Container
implements DispletCommunication

SVGPanel is the class which collects information about all the elements of a SVG document. In particular, this class stores information about groups and manages mouse events.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 
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
SVGPanel()
          Constructor.
 
Method Summary
 void add(SVGGroup group)
          Adds a SVG group (<g> tag).
 void display(java.lang.String document)
          Displays a different XML document by calling the method it.unibo.cs.xmlc.Xmlc.display
 void doLayout()
          Lay out all the components of the SVG document.
 java.util.Vector getGroups()
          Gets all the groups of the SVG document.
 int getHeight()
          Gets the height of the SVG document.
 int getWidth()
          Gets the width of the SVG document.
 void nodeClicked(java.lang.String href)
          Method from the interface DispletCommunication.
 void paint(java.awt.Graphics g)
           
protected  void paintGroupInfo(SVGGroup group, int x, int y)
          Paints the small panel containing the description of the current diagram element.
 void printString(java.lang.String s)
          Testing method from the interface DispletCommunication.
 void setHeight(int height)
          Sets the height of the SVG document.
 void setWidth(int width)
          Sets the width of the SVG document.
protected  void unpaintGroupInfo()
          Unpaints the small window containing the description of the current diagram element..
 void update(java.awt.Graphics g)
           
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addNotify, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SVGPanel

public SVGPanel()
Constructor. Initializes some variables.

Method Detail

setHeight

public void setHeight(int height)
Sets the height of the SVG document.


getHeight

public int getHeight()
Gets the height of the SVG document.

Overrides:
getHeight in class java.awt.Component
Returns:
height the height of the SVG document.

setWidth

public void setWidth(int width)
Sets the width of the SVG document.


getWidth

public int getWidth()
Gets the width of the SVG document.

Overrides:
getWidth in class java.awt.Component
Returns:
width the width of the SVG document.

doLayout

public void doLayout()
Lay out all the components of the SVG document.

Overrides:
doLayout in class java.awt.Container

add

public void add(SVGGroup group)
Adds a SVG group (<g> tag).


getGroups

public java.util.Vector getGroups()
Gets all the groups of the SVG document.

Returns:
vectorGroups the group as a java.util.Vector.

update

public void update(java.awt.Graphics g)
Overrides:
update in class java.awt.Container

paint

public void paint(java.awt.Graphics g)
Overrides:
paint in class java.awt.Container

printString

public void printString(java.lang.String s)
Testing method from the interface DispletCommunication. Prints a string to standard output.

Specified by:
printString in interface DispletCommunication

nodeClicked

public void nodeClicked(java.lang.String href)
Method from the interface DispletCommunication. Called when an element of the left-side menu is clicked.

Specified by:
nodeClicked in interface DispletCommunication

paintGroupInfo

protected void paintGroupInfo(SVGGroup group,
                              int x,
                              int y)
Paints the small panel containing the description of the current diagram element.


unpaintGroupInfo

protected void unpaintGroupInfo()
Unpaints the small window containing the description of the current diagram element..


display

public void display(java.lang.String document)
Displays a different XML document by calling the method it.unibo.cs.xmlc.Xmlc.display