org.diamondspin
Class DSSlot

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JInternalFrame
                  extended by org.diamondspin.DSFrame
                      extended by org.diamondspin.DSSlot
All Implemented Interfaces:
MouseListener, MouseMotionListener, ImageObserver, MenuContainer, Serializable, Cloneable, EventListener, Accessible, RootPaneContainer, WindowConstants, DSElement

public class DSSlot
extends DSFrame

Author:
vernier
See Also:
Serialized Form

Nested Class Summary
 class DSSlot.SlotInfo
          a local class to store element info we're going to modify during sloting and restore after all
 
Nested classes/interfaces inherited from class org.diamondspin.DSFrame
DSFrame.DSInternalFrameTitlePane, DSFrame.DSMenuBarProxy, DSFrame.FingerRotationMode, DSFrame.FingerRotationSpeed
 
Nested classes/interfaces inherited from class javax.swing.JInternalFrame
JInternalFrame.AccessibleJInternalFrame, JInternalFrame.JDesktopIcon
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
protected  double absorbAtProportion
           
static int ALIGNED
           
static int ALL_IN
           
protected  boolean autoAlign
           
protected  Color color
           
protected  boolean dirUp
           
protected  HashMap<DSFrame,DSSlot.SlotInfo> frameStates
           
static int HALF_IN
           
static int JUST_IN
           
protected  HashMap<DSFrame,DSElementListener> listenersList
           
static int NEAR_DIST
           
static int NEAR_IN
           
static int OUT
           
static int SLOT_HEIGHT
           
static int SLOT_SHADOW_HEIGHT
           
 
Fields inherited from class org.diamondspin.DSFrame
absoluteScale, absoluteShiftAngle, active, alpha, ALWAYS, annotatable, ANNOTATING, ANNOTATING_SINGLE_TIME, annotationOptions, backGlassPane, backPane, behavior, beta, betaAbsFlag, BETATED, biftpBottom, biftpTop, BLACK, BOTH, BOTTOM, CAST, center, CENTER, CENTERED, clickedComponent, clickedSlave, COLORBITS, corner_fold, corner_rotation, CORNER_SIZE, corners_resize_BR, corners_resize_TL, curvature, d, DARKER, diffAngle, DRAGGING, dsTabletopPane, dTopLeftCorner, ERASER, eraserIconPressed, ERASING, fingerRotatable, fingerRotationMode, fingerRotationSpeed, fixedPointForRotation, FOLDING, foldingManager, FOLLOWING_TWO_FINGERS, frontier, GLASS, globalPoint, grabCornerPoint, GRAY, idOwner, IN_BETWEEN, inertiaType, initDiagonal, inkIcon, inkIconPressed, INTELIGENT, invertiaCenter, invertiaMesh, jComboBox1, jViewport1, lastComponent, lastComponentUsed, lastRotationEvent, logoIcon, maximumScale, menubar, MIDDLE, minimumScale, mode, NONE, oldmenubar, OPPOSITE, previousMousePosition, previousPreviousMousePosition, RESIZING_BR, RESIZING_TL, rotatable, ROTATED, ROTATING, savedBeta, savedCenter, savedRotationCornerPosition, scale, scaleCorrection, serialVersionUID, shadow, shadowManager, shadowNeedRefresh, SHIFTED, slaveElementList, slavePosition, SMALL, thisDSFrame, titlebar, TOP, transparency, USER_COLOR, WAITING, zoomable, ZOOMING_BR, ZOOMING_TL
 
Fields inherited from class javax.swing.JInternalFrame
closable, CONTENT_PANE_PROPERTY, desktopIcon, FRAME_ICON_PROPERTY, frameIcon, GLASS_PANE_PROPERTY, iconable, IS_CLOSED_PROPERTY, IS_ICON_PROPERTY, IS_MAXIMUM_PROPERTY, IS_SELECTED_PROPERTY, isClosed, isIcon, isMaximum, isSelected, LAYERED_PANE_PROPERTY, maximizable, MENU_BAR_PROPERTY, resizable, ROOT_PANE_PROPERTY, rootPane, rootPaneCheckingEnabled, title, TITLE_PROPERTY
 
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 org.diamondspin.DSElement
HIGH_QUALITY, LOW_QUALITY
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
DSSlot(DSTabletopPane dsp, boolean dirUp)
          Creates a new instance of DSSlot
 
Method Summary
 void absorb(DSFrame src)
           
static Point2D.Double computeIntersection(Point2D.Double A, Point2D.Double B, Point2D.Double C, Point2D.Double D)
          Compute the intersection of two segment described by two points each
static DSSlot findSlot(DSFrame fr)
           
 double getAbsorbAtProportion()
           
 Color getColor()
           
 HashMap<DSFrame,Double> getElementList()
           
 boolean isAutoAlign()
           
 boolean isDirUp()
           
 boolean isSlotted(DSFrame fr)
          return if such frame element is inside the slot
 void mousePressed(MouseEvent event)
          Handle a mouse button press event
 double prepareToTakeOut(DSFrame fr)
          prepqre to take out
 void registerDSFrameForSloting(DSFrame fr)
           
 void removeElementFromSlot(DSFrame fr)
          remove an element from the slot and make it upright
 void setAbsorbAtProportion(double absorbAtProportion)
           
 void setAutoAlign(boolean autoAlign)
           
 void setBeta(double b)
          change the angle around its own center, not the center of the polar coordinate system
 void setColor(Color color)
           
 void setDirUp(boolean dirUp)
           
 void unregisterDSFrameForSloting(DSFrame fr)
           
 void updateSloting(DSFrame src)
          update the state of a possible slotted element src
 
Methods inherited from class org.diamondspin.DSFrame
acceptSlave, acceptSlaveRelease, acceptSlavery, acceptSlaveryRelease, addDSElementListener, addDSElementPreListener, addFooterButton, addHeaderButton, addSlaveElement, addSlaveElement, askRefreshShadow, computeShadowPosition, contains, containsBack, containsFront, createImage, disableSnaping, doesContain, doesContainBack, doesContainFront, fireDSElementCenterChangedEvent, fireDSelementContentRepainted, fireDSElementDemotedEvent, fireDSElementDroppedEvent, fireDSElementFoldedEvent, fireDSElementGrabbingEvent, fireDSElementMovedEvent, fireDSElementPreCenterChangedEvent, fireDSElementPreFoldedEvent, fireDSElementPreMovedEvent, fireDSElementPreResizedEvent, fireDSElementPreRotatedEvent, fireDSElementPreZoomedEvent, fireDSElementResizedEvent, fireDSElementRotatedEvent, fireDSElementZoomedEvent, foldTo, getAbsoluteScale, getAlpha, getBackClippingShape, getBackGlassPane, getBackImage, getBackOpacity, getBackPane, getBackPaneHeight, getBackPaneWidth, getBackTransform, getBehavior, getBeta, getBounds, getBounds, getCenter, getD, getDSElementListener, getDSElementPreListener, getDSTabletopPane, getFingerRotationMode, getFingerRotationSpeed, getFoldPoint, getFoldPoint1, getFoldPoint2, getFoldProportion, getFoldShapeBack, getFoldShapeFront, getFoldType, getFrontClippingShape, getFrontier, getFrontImage, getFrontOpacity, getGlobalClippingShape, getGraphics, getIDOwner, getInertiaType, getJMenuBar, getJMenuBarPosition, getLocationOnScreen, getMaximumScale, getMinimumScale, getMinimumSize, getMode, getParent, getScale, getShadow, getShadowAdditionnalAngle, getShadowClip, getShadowDistance, getShadowImage, getShadowPosition, getShadowSize, getSlaveElementList, getSlavePosition, getSlaveTransform, getSnapAngle, getTabletopPane, getTitleBarPosition, getTransform, getTransparency, getViewPort, grabElement, inertiaCenter, inertiaMesh, inversePoint, inversePoint, inversePointBack, inverseVector, inverseVectorBack, isActive, isADragObject, isAnnotatable, isBetaAbs, isClip, isCornerFold, isCornerRotation, isCorners, isCornersResizeBR, isCornersResizeTL, isFingerRotatable, isFoldable, isFolded, isFoldReverse, isMouseTarget, isMyDragObject, isRotatable, isShadowHighQuality, isShadowSource, isShowing, isZoomable, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressedInside, mousePressedInsideBack, mousePressedTestBack, mousePressedTestFront, mouseReleased, moveCenter, moveCenter, moveElementCenterTo, paint, paint, paintBackInternal, paintFoldCorner, paintInternal, paintMenu2, paintResizeCornerBR, paintResizeCornerTL, paintRotateCorner, paintShadow, paintShadowOld, paintSlaves, paintSoftBorder, redispatchEvent, refreshShadow, removeAllSlaveElement, removeDSElementListener, removeDSElementPreListener, removeSlaveElement, repaint, resetSlaveFrame, reshape, setAbsoluteScale, setActive, setAllCorners, setAlpha, setAlphaAndD, setAnnotable, setAnnotatable, setAnnotationOptions, setBackClippingShape, setBackGlassPane, setBackOpacity, setBackPane, setBehavior, setBeta, setBetaAbs, setCenter, setCenterTo, setCenterTo, setCornerFold, setCornerRotation, setCornersResizeBR, setCornersResizeTL, setD, setFingerRotatable, setFingerRotationMode, setFingerRotationSpeed, setFoldable, setFoldReverse, setFrontClippingShape, setFrontier, setFrontOpacity, setGlobalClippingShape, setIcon, setIDOwner, setInertiaType, setJMenuBar, setJMenuBarPosition, setMaximumScale, setMinimumScale, setMode, setPreferredSize, setRotatable, setRotationCorner, setScale, setShadow, setShadowAdditionnalAngle, setShadowClip, setShadowDistance, setShadowHighQuality, setShadowSource, setSize, setSize, setSlavePosition, setSlaveTransform, setSnapAngle, setTitleBarPosition, setTransparency, setViewPort, setZoomable, startAnnotating, toString, transformBackToLocal, transformPoint, transformPoint, transformVector, unfold, validate
 
Methods inherited from class javax.swing.JInternalFrame
addImpl, addInternalFrameListener, createRootPane, dispose, doDefaultCloseAction, fireInternalFrameEvent, getAccessibleContext, getContentPane, getDefaultCloseOperation, getDesktopIcon, getDesktopPane, getFocusCycleRootAncestor, getFocusOwner, getFrameIcon, getGlassPane, getInternalFrameListeners, getLastCursor, getLayer, getLayeredPane, getMenuBar, getMostRecentFocusOwner, getNormalBounds, getRootPane, getTitle, getUI, getUIClassID, getWarningString, hide, isClosable, isClosed, isFocusCycleRoot, isIcon, isIconifiable, isMaximizable, isMaximum, isResizable, isRootPaneCheckingEnabled, isSelected, moveToBack, moveToFront, pack, paintComponent, paramString, remove, removeInternalFrameListener, restoreSubcomponentFocus, setClosable, setClosed, setContentPane, setCursor, setDefaultCloseOperation, setDesktopIcon, setFocusCycleRoot, setFrameIcon, setGlassPane, setIconifiable, setLayer, setLayer, setLayeredPane, setLayout, setMaximizable, setMaximum, setMenuBar, setNormalBounds, setResizable, setRootPane, setRootPaneCheckingEnabled, setSelected, setTitle, setUI, show, toBack, toFront, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, transferFocusBackward, transferFocusDownCycle, 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, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, 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, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, show, size, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.diamondspin.DSElement
getHeight, getWidth, isVisible, setVisible
 

Field Detail

frameStates

protected HashMap<DSFrame,DSSlot.SlotInfo> frameStates

listenersList

protected HashMap<DSFrame,DSElementListener> listenersList

color

protected Color color

autoAlign

protected boolean autoAlign

dirUp

protected boolean dirUp

absorbAtProportion

protected double absorbAtProportion

OUT

public static final int OUT
See Also:
Constant Field Values

ALIGNED

public static final int ALIGNED
See Also:
Constant Field Values

NEAR_IN

public static final int NEAR_IN
See Also:
Constant Field Values

JUST_IN

public static final int JUST_IN
See Also:
Constant Field Values

HALF_IN

public static final int HALF_IN
See Also:
Constant Field Values

ALL_IN

public static final int ALL_IN
See Also:
Constant Field Values

NEAR_DIST

public static final int NEAR_DIST
See Also:
Constant Field Values

SLOT_SHADOW_HEIGHT

public static final int SLOT_SHADOW_HEIGHT
See Also:
Constant Field Values

SLOT_HEIGHT

public static final int SLOT_HEIGHT
See Also:
Constant Field Values
Constructor Detail

DSSlot

public DSSlot(DSTabletopPane dsp,
              boolean dirUp)
Creates a new instance of DSSlot

Parameters:
dirUp - indicate if document must be inserted from bottom to top or reverse
Method Detail

getElementList

public HashMap<DSFrame,Double> getElementList()

prepareToTakeOut

public double prepareToTakeOut(DSFrame fr)
prepqre to take out


removeElementFromSlot

public void removeElementFromSlot(DSFrame fr)
remove an element from the slot and make it upright


isSlotted

public boolean isSlotted(DSFrame fr)
return if such frame element is inside the slot


findSlot

public static DSSlot findSlot(DSFrame fr)
Returns:
if the given dsframe is in the slot

computeIntersection

public static Point2D.Double computeIntersection(Point2D.Double A,
                                                 Point2D.Double B,
                                                 Point2D.Double C,
                                                 Point2D.Double D)
Compute the intersection of two segment described by two points each

Returns:
null if there's no intersection, the intersection point otherwise

mousePressed

public void mousePressed(MouseEvent event)
Description copied from class: DSFrame
Handle a mouse button press event

Specified by:
mousePressed in interface MouseListener
Specified by:
mousePressed in interface DSElement
Overrides:
mousePressed in class DSFrame
Parameters:
event - The mouseEvent with more details on the event

updateSloting

public void updateSloting(DSFrame src)
update the state of a possible slotted element src


setBeta

public void setBeta(double b)
Description copied from class: DSFrame
change the angle around its own center, not the center of the polar coordinate system

Specified by:
setBeta in interface DSElement
Overrides:
setBeta in class DSFrame
Parameters:
b - The new beta value

unregisterDSFrameForSloting

public void unregisterDSFrameForSloting(DSFrame fr)

registerDSFrameForSloting

public void registerDSFrameForSloting(DSFrame fr)

absorb

public void absorb(DSFrame src)

getColor

public Color getColor()

setColor

public void setColor(Color color)

isAutoAlign

public boolean isAutoAlign()

setAutoAlign

public void setAutoAlign(boolean autoAlign)

isDirUp

public boolean isDirUp()

setDirUp

public final void setDirUp(boolean dirUp)

getAbsorbAtProportion

public double getAbsorbAtProportion()

setAbsorbAtProportion

public void setAbsorbAtProportion(double absorbAtProportion)


Copyright © 2006 Frederic Vernier(LIMSI) Chia Shen(MERL) Guillaume Besacier(LIMSI). All Rights Reserved.