Sweet Home 3D 3.4

com.eteks.sweethome3d.swing
Class MultipleLevelsPlanPanel

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by com.eteks.sweethome3d.swing.MultipleLevelsPlanPanel
All Implemented Interfaces:
PlanView, View, java.awt.image.ImageObserver, java.awt.MenuContainer, java.awt.print.Printable, java.io.Serializable, javax.accessibility.Accessible

public class MultipleLevelsPlanPanel
extends javax.swing.JPanel
implements PlanView, java.awt.print.Printable

A panel for multiple levels plans where users can select the displayed level.

Author:
Emmanuel Puybaret
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Nested classes/interfaces inherited from interface com.eteks.sweethome3d.viewcontroller.PlanView
PlanView.CursorType
 
Field Summary
 
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.print.Printable
NO_SUCH_PAGE, PAGE_EXISTS
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
MultipleLevelsPlanPanel(Home home, UserPreferences preferences, PlanController controller)
           
 
Method Summary
 void addFocusListener(java.awt.event.FocusListener l)
           
 void addMouseListener(java.awt.event.MouseListener l)
           
 void addMouseMotionListener(java.awt.event.MouseMotionListener l)
           
 boolean canImportDraggedItems(java.util.List<Selectable> items, int x, int y)
          Returns true if the given coordinates belong to the plan displayed by this component.
 int convertXModelToScreen(float x)
          Returns x converted in screen coordinates space.
 float convertXPixelToModel(int x)
          Returns x converted in model coordinates space.
 int convertYModelToScreen(float y)
          Returns y converted in screen coordinates space.
 float convertYPixelToModel(int y)
          Returns y converted in model coordinates space.
 void deleteFeedback()
          Deletes all elements shown as feedback.
 void deleteToolTipFeedback()
          Deletes tool tip text from screen.
 View getHorizontalRuler()
          Returns the component used as an horizontal ruler for the plan displayed by this component.
 float getPixelLength()
          Returns the length in centimeters of a pixel with the current scale.
 float getScale()
          Returns the scale used to display the plan displayed by this component.
 float[][] getTextBounds(java.lang.String text, TextStyle style, float x, float y, float angle)
          Returns the coordinates of the bounding rectangle of the text displayed at the point (x,y).
 View getVerticalRuler()
          Returns the component used as a vertical ruler for the plan displayed by this component.
 void makePointVisible(float x, float y)
          Ensures the point at (x, y) is visible in the plan displayed by this component, moving its scroll bars if needed.
 void makeSelectionVisible()
          Ensures selected items are visible in the plan displayed by this component and moves its scroll bars if needed.
 void moveView(float dx, float dy)
          Moves the plan displayed by this component from (dx, dy) unit in the scrolling zone it belongs to.
 int print(java.awt.Graphics graphics, java.awt.print.PageFormat pageFormat, int pageIndex)
          Prints the plan component.
 void setAlignmentFeedback(java.lang.Class<? extends Selectable> alignedObjectClass, Selectable alignedObject, float x, float y, boolean showPoint)
          Sets the location point for alignment feedback.
 void setAngleFeedback(float xCenter, float yCenter, float x1, float y1, float x2, float y2)
          Sets the points used to draw an angle in the plan displayed by this component.
 void setComponentPopupMenu(javax.swing.JPopupMenu popup)
           
 void setCursor(PlanView.CursorType cursorType)
          Sets the cursor of this component as rotation cursor.
 void setDimensionLinesFeedback(java.util.List<DimensionLine> dimensionLines)
          Sets the given dimension lines to be drawn as feedback.
 void setDraggedItemsFeedback(java.util.List<Selectable> draggedItems)
          Sets the feedback of dragged items drawn during a drag and drop operation, initiated from outside of the plan displayed by this component.
 void setRectangleFeedback(float x0, float y0, float x1, float y1)
          Sets rectangle selection feedback coordinates.
 void setResizeIndicatorVisible(boolean visible)
          Sets whether the resize indicator of selected wall or piece of furniture should be visible or not.
 void setScale(float scale)
          Sets the scale used to display the plan displayed by this component.
 void setToolTipEditedProperties(PlanController.EditableProperty[] toolTipEditedProperties, java.lang.Object[] toolTipPropertyValues, float x, float y)
          Set properties edited in tool tip.
 void setToolTipFeedback(java.lang.String toolTipFeedback, float x, float y)
          Sets tool tip text displayed as feedback.
 void setTransferHandler(javax.swing.TransferHandler newHandler)
           
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, 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, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, 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, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, 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, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MultipleLevelsPlanPanel

public MultipleLevelsPlanPanel(Home home,
                               UserPreferences preferences,
                               PlanController controller)
Method Detail

setTransferHandler

public void setTransferHandler(javax.swing.TransferHandler newHandler)
Overrides:
setTransferHandler in class javax.swing.JComponent

setComponentPopupMenu

public void setComponentPopupMenu(javax.swing.JPopupMenu popup)
Overrides:
setComponentPopupMenu in class javax.swing.JComponent

addMouseMotionListener

public void addMouseMotionListener(java.awt.event.MouseMotionListener l)
Overrides:
addMouseMotionListener in class java.awt.Component

addMouseListener

public void addMouseListener(java.awt.event.MouseListener l)
Overrides:
addMouseListener in class java.awt.Component

addFocusListener

public void addFocusListener(java.awt.event.FocusListener l)
Overrides:
addFocusListener in class java.awt.Component

setRectangleFeedback

public void setRectangleFeedback(float x0,
                                 float y0,
                                 float x1,
                                 float y1)
Sets rectangle selection feedback coordinates.

Specified by:
setRectangleFeedback in interface PlanView

makeSelectionVisible

public void makeSelectionVisible()
Ensures selected items are visible in the plan displayed by this component and moves its scroll bars if needed.

Specified by:
makeSelectionVisible in interface PlanView

makePointVisible

public void makePointVisible(float x,
                             float y)
Ensures the point at (x, y) is visible in the plan displayed by this component, moving its scroll bars if needed.

Specified by:
makePointVisible in interface PlanView

getScale

public float getScale()
Returns the scale used to display the plan displayed by this component.

Specified by:
getScale in interface PlanView

setScale

public void setScale(float scale)
Sets the scale used to display the plan displayed by this component.

Specified by:
setScale in interface PlanView

moveView

public void moveView(float dx,
                     float dy)
Moves the plan displayed by this component from (dx, dy) unit in the scrolling zone it belongs to.

Specified by:
moveView in interface PlanView

convertXPixelToModel

public float convertXPixelToModel(int x)
Returns x converted in model coordinates space.

Specified by:
convertXPixelToModel in interface PlanView

convertYPixelToModel

public float convertYPixelToModel(int y)
Returns y converted in model coordinates space.

Specified by:
convertYPixelToModel in interface PlanView

convertXModelToScreen

public int convertXModelToScreen(float x)
Returns x converted in screen coordinates space.

Specified by:
convertXModelToScreen in interface PlanView

convertYModelToScreen

public int convertYModelToScreen(float y)
Returns y converted in screen coordinates space.

Specified by:
convertYModelToScreen in interface PlanView

getPixelLength

public float getPixelLength()
Returns the length in centimeters of a pixel with the current scale.

Specified by:
getPixelLength in interface PlanView

getTextBounds

public float[][] getTextBounds(java.lang.String text,
                               TextStyle style,
                               float x,
                               float y,
                               float angle)
Returns the coordinates of the bounding rectangle of the text displayed at the point (x,y).

Specified by:
getTextBounds in interface PlanView

setCursor

public void setCursor(PlanView.CursorType cursorType)
Sets the cursor of this component as rotation cursor.

Specified by:
setCursor in interface PlanView

setToolTipFeedback

public void setToolTipFeedback(java.lang.String toolTipFeedback,
                               float x,
                               float y)
Sets tool tip text displayed as feedback.

Specified by:
setToolTipFeedback in interface PlanView
Parameters:
toolTipFeedback - the text displayed in the tool tip or null to make tool tip disappear.

setToolTipEditedProperties

public void setToolTipEditedProperties(PlanController.EditableProperty[] toolTipEditedProperties,
                                       java.lang.Object[] toolTipPropertyValues,
                                       float x,
                                       float y)
Set properties edited in tool tip.

Specified by:
setToolTipEditedProperties in interface PlanView

deleteToolTipFeedback

public void deleteToolTipFeedback()
Deletes tool tip text from screen.

Specified by:
deleteToolTipFeedback in interface PlanView

setResizeIndicatorVisible

public void setResizeIndicatorVisible(boolean visible)
Sets whether the resize indicator of selected wall or piece of furniture should be visible or not.

Specified by:
setResizeIndicatorVisible in interface PlanView

setAlignmentFeedback

public void setAlignmentFeedback(java.lang.Class<? extends Selectable> alignedObjectClass,
                                 Selectable alignedObject,
                                 float x,
                                 float y,
                                 boolean showPoint)
Sets the location point for alignment feedback.

Specified by:
setAlignmentFeedback in interface PlanView

setAngleFeedback

public void setAngleFeedback(float xCenter,
                             float yCenter,
                             float x1,
                             float y1,
                             float x2,
                             float y2)
Sets the points used to draw an angle in the plan displayed by this component.

Specified by:
setAngleFeedback in interface PlanView

setDraggedItemsFeedback

public void setDraggedItemsFeedback(java.util.List<Selectable> draggedItems)
Sets the feedback of dragged items drawn during a drag and drop operation, initiated from outside of the plan displayed by this component.

Specified by:
setDraggedItemsFeedback in interface PlanView

setDimensionLinesFeedback

public void setDimensionLinesFeedback(java.util.List<DimensionLine> dimensionLines)
Sets the given dimension lines to be drawn as feedback.

Specified by:
setDimensionLinesFeedback in interface PlanView

deleteFeedback

public void deleteFeedback()
Deletes all elements shown as feedback.

Specified by:
deleteFeedback in interface PlanView

canImportDraggedItems

public boolean canImportDraggedItems(java.util.List<Selectable> items,
                                     int x,
                                     int y)
Returns true if the given coordinates belong to the plan displayed by this component.

Specified by:
canImportDraggedItems in interface PlanView

getHorizontalRuler

public View getHorizontalRuler()
Returns the component used as an horizontal ruler for the plan displayed by this component.

Specified by:
getHorizontalRuler in interface PlanView

getVerticalRuler

public View getVerticalRuler()
Returns the component used as a vertical ruler for the plan displayed by this component.

Specified by:
getVerticalRuler in interface PlanView

print

public int print(java.awt.Graphics graphics,
                 java.awt.print.PageFormat pageFormat,
                 int pageIndex)
          throws java.awt.print.PrinterException
Prints the plan component.

Specified by:
print in interface java.awt.print.Printable
Throws:
java.awt.print.PrinterException

Sweet Home 3D 3.4

? Copyrights 2006-2011 eTeks - All rights reserved
Distributed under GNU General Public License