|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--javax.swing.JPanel | +--crw.framework.GraphicComponent
The top most super class of the visual component hierachy.
Inner classes inherited from class javax.swing.JPanel |
javax.swing.JPanel.AccessibleJPanel |
Inner classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
Inner classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
Inner classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent |
Field Summary | |
protected java.awt.Image |
bufferImg
The offscreen buffer, for double buffering |
protected boolean |
changed
for event handling. |
protected boolean |
changing
for double buffering, if this component is continuously changing -- we need to repaint this component every time. |
protected int |
deltaX
the translated x coordinate |
protected int |
deltaY
the translated y coordinate |
protected boolean |
firstTime
for the first time drawing. |
protected java.awt.Image |
fixedImg
The offscreen buffer, for fixed image to improve the efficiency of the screen redering |
protected java.awt.Graphics |
gBuffer
The graphic context of bufferImg |
protected java.awt.Graphics |
gFixed
The graphic context of gFixed |
protected java.awt.Dimension |
imgSize
the image size of this visual component. |
protected GraphicComponent |
parent
the parent container (GraphicComposite) for this GraphicComponent |
protected boolean |
translated
iff true, this component has been translated otherwise, no translation to this component |
Fields inherited from class javax.swing.JComponent |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
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 | |
GraphicComponent()
the abstract super class defualt constructor. |
|
GraphicComponent(java.awt.Dimension imgSize)
the constructor |
Method Summary | |
void |
addGraphicComponent(GraphicComponent gc)
add a graphic component to be overrided by the GraphicComposite class. |
void |
draw(java.awt.Graphics g)
draw method. |
void |
drawThisCompFixedImg()
draw this component's fixed image. |
void |
drawThisComponent(java.awt.Graphics g)
abstract method to draw this component. |
java.awt.Dimension |
getImageSize()
get the image size of this component |
java.awt.Point |
getNewPosition()
get this component's new position after the translation return the new original coordinates of this component after it is translated. |
java.awt.Point |
getThisComponentActualPosition()
get the actual position of this GraphicComponent after all the translations of its parent's and grandparant's transaltions |
boolean |
isThisComponentAlwaysChanging()
get the state if this graphicComponent is continuously changed |
boolean |
isThisComponentChanged()
get the state if this graphicComponent is changed by a user event |
boolean |
isTranslated()
test if this GraphicComponent has been translated |
void |
paintComponent(java.awt.Graphics g)
to be able to compatible with java2 naming convention |
void |
removeGraphicComponent(GraphicComponent gc)
to remove a GraphicComponent object to be overrided by the GraphicComposite class. |
void |
setBufferImg(java.awt.Image bufferImg)
set the bufferImg for this component to be set by the top-level GraphicComposite |
void |
setBufGraphics(java.awt.Graphics gBuffer)
set the gBuffer for this visual component to be set by the top-level GraphicComposite |
void |
setFixedImg(java.awt.Image fixedImg)
set the fixedImg for this component to be set by the top-level GraphicComposite |
void |
setFxdGraphics(java.awt.Graphics gFixed)
set the gFixed for this visual component to be set by the top-level GraphicComposite |
void |
setImageSize(java.awt.Dimension imgSize)
set the image size of this component. |
void |
setParent(GraphicComponent gc)
set the parent GraphicComposite for this GraphicComponent |
void |
setThisComponentAlwaysChanging(boolean changing)
set the state, iff this component is continuously changed |
void |
setThisComponentChanged(boolean changed)
set the state, iff this GraphicComponent is changed by a user event |
void |
translate(int deltaX,
int deltaY)
set up the traslation. |
Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUIClassID, paramString, updateUI |
Methods inherited from class javax.swing.JComponent |
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getVerifyInputWhenFocusTarget, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, hide, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processFocusEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setLayout, validate, validateTree |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, imageUpdate, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected java.awt.Image bufferImg
protected java.awt.Graphics gBuffer
protected java.awt.Image fixedImg
protected java.awt.Graphics gFixed
protected boolean translated
protected int deltaX
protected int deltaY
protected java.awt.Dimension imgSize
protected boolean changing
protected boolean changed
protected boolean firstTime
protected GraphicComponent parent
Constructor Detail |
public GraphicComponent()
public GraphicComponent(java.awt.Dimension imgSize)
imgSize
- the image size of this visual componentMethod Detail |
public void draw(java.awt.Graphics g)
public void drawThisCompFixedImg()
public void drawThisComponent(java.awt.Graphics g)
g
- the graphic context, provided by the parent compositepublic void paintComponent(java.awt.Graphics g)
paintComponent
in class javax.swing.JComponent
g
- the graphic context, provided by the parent compositepublic void addGraphicComponent(GraphicComponent gc)
gc
- the GraphicComponent objectpublic void removeGraphicComponent(GraphicComponent gc)
gc
- the GraphicComponent objectpublic void translate(int deltaX, int deltaY)
deltaX
- the translated x coordinatedeltaY
- the translated y coordinatepublic boolean isTranslated()
public java.awt.Point getNewPosition()
public void setImageSize(java.awt.Dimension imgSize)
imgSize
- the image size of this visual componentpublic java.awt.Dimension getImageSize()
public void setBufferImg(java.awt.Image bufferImg)
public void setFixedImg(java.awt.Image fixedImg)
public void setBufGraphics(java.awt.Graphics gBuffer)
public void setFxdGraphics(java.awt.Graphics gFixed)
public void setThisComponentChanged(boolean changed)
changed
- iff true, this component is changed and need to be
updated next time of rederring the screenpublic boolean isThisComponentChanged()
public void setThisComponentAlwaysChanging(boolean changing)
changed
- iff tru, this component is constantly changed,
and need to be updated every time rederring the screenpublic boolean isThisComponentAlwaysChanging()
public void setParent(GraphicComponent gc)
public java.awt.Point getThisComponentActualPosition()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |