org.devaki.nextobjects.workspace.models.graphics
Class BaseModelView

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JPanel
                  extended byorg.devaki.nextobjects.workspace.models.graphics.BaseModelView
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable
Direct Known Subclasses:
ConceptualView, PhysicalView

public abstract class BaseModelView
extends javax.swing.JPanel
implements java.io.Serializable

The base for all models

Author:
Emmanuel Florent
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
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
protected  java.awt.image.BufferedImage bi
          The buffered image
 javax.swing.JPanel drawingArea
          the drawing area
protected  int dx
          X difference between x1 and object location
protected  int dy
          Y difference between x1 and object location
protected  boolean fullRefresh
          full drawing refresh
 javax.swing.JScrollPane jScrollPane
          the scrollpane
protected  BaseModel myModel
          the context model
protected  java.awt.Rectangle rectangle
          the model bounds
protected  int x1
          X coordinates used when mouse clicking
protected  int x2
          X coordinates used when mouse draging
protected  int y1
          Y coordinates used when mouse clicking
protected  int y2
          Y coordinates used when mouse draging
 
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.Container
 
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
BaseModelView(BaseModel pModel)
          constructor
 
Method Summary
 java.awt.Rectangle calculateRectangle()
          Calculate a cached model rectangle
 java.awt.Point center(boolean actIt)
          Compute a location point for this viewport to have a centered view of the model
 ModelTitleView getModelTitleView()
          get the model title view
 BaseModel getMyModel()
          get the model
 java.awt.Rectangle getRectangle()
          Return a cached rectangle/bounds for the model
 java.awt.Point getViewPosition()
          Location of the view position
 java.awt.Dimension getViewSize()
          return the view size
abstract  ObjectView[] getVisibleObjectView()
          get the visible objects
 void setFullRefresh(boolean b)
          Set if to refresh the drawing at next paint
 void setMyModel(BaseModel model)
          set the model
 void setViewPosition(java.awt.Point p)
          Set the view position
 void setViewSize(java.awt.Dimension d)
          set the dimension
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, 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, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, 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, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

x1

protected int x1
X coordinates used when mouse clicking


y1

protected int y1
Y coordinates used when mouse clicking


x2

protected int x2
X coordinates used when mouse draging


y2

protected int y2
Y coordinates used when mouse draging


dx

protected int dx
X difference between x1 and object location


dy

protected int dy
Y difference between x1 and object location


rectangle

protected java.awt.Rectangle rectangle
the model bounds


myModel

protected BaseModel myModel
the context model


drawingArea

public javax.swing.JPanel drawingArea
the drawing area


jScrollPane

public javax.swing.JScrollPane jScrollPane
the scrollpane


fullRefresh

protected boolean fullRefresh
full drawing refresh


bi

protected transient java.awt.image.BufferedImage bi
The buffered image

Constructor Detail

BaseModelView

public BaseModelView(BaseModel pModel)
constructor

Parameters:
pModel - the model
Method Detail

getVisibleObjectView

public abstract ObjectView[] getVisibleObjectView()
get the visible objects

Returns:
the object views

getRectangle

public java.awt.Rectangle getRectangle()
Return a cached rectangle/bounds for the model

Returns:
the rectangle

center

public java.awt.Point center(boolean actIt)
Compute a location point for this viewport to have a centered view of the model

Parameters:
actIt - optiopnaly center the model
Returns:
the center

calculateRectangle

public java.awt.Rectangle calculateRectangle()
Calculate a cached model rectangle

Returns:
Description of the Return Value

getMyModel

public BaseModel getMyModel()
get the model

Returns:
the model

setMyModel

public void setMyModel(BaseModel model)
set the model

Parameters:
model - the model

setViewSize

public void setViewSize(java.awt.Dimension d)
set the dimension

Parameters:
d - the dimension

getViewSize

public java.awt.Dimension getViewSize()
return the view size

Returns:
the location

setFullRefresh

public void setFullRefresh(boolean b)
Set if to refresh the drawing at next paint

Parameters:
b - full refresh

getViewPosition

public java.awt.Point getViewPosition()
Location of the view position

Returns:
the point

setViewPosition

public void setViewPosition(java.awt.Point p)
Set the view position

Parameters:
p - the top left corner to clip the drawings.

getModelTitleView

public ModelTitleView getModelTitleView()
get the model title view

Returns:
the model "cartouche"


Copyright © 2002-2004 devaki.org. All Rights Reserved.