Class DrawObj

java.lang.Object
  |
  +--java.awt.Component
        |
        +--DrawObj
Direct Known Subclasses:
PointObj, PolyObj, RectObj

public abstract class DrawObj
extends java.awt.Component

This super class is a generic drawing object. All drawing object contains in the map must be inherit from DrawObj.

Author:
Guy Parent
See Also:
Serialized Form

Inner classes inherited from class java.awt.Component
java.awt.Component.AWTTreeLock
 
Field Summary
protected  java.awt.Color color
          Color used to draw the object.
protected  java.awt.Graphics g
          Graphic object use to draw.
 
Fields inherited from class java.awt.Component
actionListenerK, adjustmentListenerK, appContext, assert, background, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, changeSupport, componentListener, componentListenerK, componentOrientation, componentSerializedDataVersion, containerListenerK, cursor, dropTarget, enabled, eventMask, focusListener, focusListenerK, font, foreground, hasFocus, height, incRate, inputMethodListener, inputMethodListenerK, isInc, isPacked, itemListenerK, keyListener, keyListenerK, LEFT_ALIGNMENT, locale, LOCK, minSize, mouseListener, mouseListenerK, mouseMotionListener, mouseMotionListenerK, name, nameExplicitlySet, newEventsOnly, ownedWindowK, parent, peer, peerFont, popups, prefSize, RIGHT_ALIGNMENT, serialVersionUID, textListenerK, TOP_ALIGNMENT, valid, visible, width, windowListenerK, x, y
 
Constructor Summary
DrawObj()
           
 
Method Summary
abstract  void destroyEvent()
          Destroy all listener or object event.
abstract  void draw()
          Used to draw the drawing object.
 java.awt.Color getColor()
          Return the current color.
abstract  java.lang.String getSubmitValue()
          This method will be called at the end of operation.
 void paint(java.awt.Graphics mapG)
          Repaint all drawing object.
abstract  void resize(java.awt.Point p)
          This method is called when the drawing object change size.
 void setColor(java.awt.Color color)
          Set the current color.
 
Methods inherited from class java.awt.Component
, action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, areInputMethodsEnabled, bounds, checkImage, checkImage, coalesceEvents, constructComponentName, contains, contains, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, dispatchEventImpl, doLayout, enable, enable, enableEvents, enableInputMethods, eventEnabled, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont_NoClientCode, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputContext, getInputMethodRequests, getIntrinsicCursor, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getName, getNativeContainer, getParent_NoClientCode, getParent, getPeer, getPreferredSize, getSize, getSize, getToolkit, getToolkitImpl, getTreeLock, getWidth, getWindowForObject, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, initIDs, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isEnabledImpl, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, lightweightPrint, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, postsOldMouseEvents, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, readObject, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, update, validate, writeObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

color

protected java.awt.Color color
Color used to draw the object.

g

protected java.awt.Graphics g
Graphic object use to draw.
Constructor Detail

DrawObj

public DrawObj()
Method Detail

setColor

public void setColor(java.awt.Color color)
Set the current color.
Parameters:
color -  
See Also:
Color

getColor

public java.awt.Color getColor()
Return the current color.

destroyEvent

public abstract void destroyEvent()
Destroy all listener or object event. It must be overload.

paint

public void paint(java.awt.Graphics mapG)
Repaint all drawing object. This method will be called after an invalidate region.
Overrides:
paint in class java.awt.Component

getSubmitValue

public abstract java.lang.String getSubmitValue()
This method will be called at the end of operation. It must return the value which it put in the value parameter in the submit operation.
Returns:
String containing the submit value.
See Also:
Rosa applet parameters

draw

public abstract void draw()
Used to draw the drawing object. In general, it will call on mouse move. It must be overload.

resize

public abstract void resize(java.awt.Point p)
This method is called when the drawing object change size.
Parameters:
p - new coordinate.