public class MultipleLevelsPlanPanel extends javax.swing.JPanel implements PlanView, java.awt.print.Printable
javax.swing.JPanel.AccessibleJPaneljavax.swing.JComponent.AccessibleJComponentjava.awt.Container.AccessibleAWTContainerjava.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategyPlanView.CursorTypeTransferableView.DataType, TransferableView.TransferObserverExportableView.FormatTypeView.PointerTypelistenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW| Constructor and Description |
|---|
MultipleLevelsPlanPanel(Home home,
UserPreferences preferences,
PlanController controller) |
| Modifier and Type | Method and Description |
|---|---|
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. |
protected PlanView |
createPlanComponent(Home home,
UserPreferences preferences,
PlanController controller)
Creates and returns the main plan component displayed and layout by this component.
|
java.lang.Object |
createTransferData(TransferableView.DataType dataType)
Returns an image of the plan for transfer purpose.
|
void |
deleteFeedback()
Deletes all elements shown as feedback.
|
void |
deleteToolTipFeedback()
Deletes tool tip text from screen.
|
void |
exportData(java.io.OutputStream out,
ExportableView.FormatType formatType,
java.util.Properties settings)
Writes the plan in the given output stream at SVG (Scalable Vector Graphics) format if this is the requested format.
|
java.awt.Cursor |
getCursor()
Returns the cursor of this component.
|
View |
getHorizontalRuler()
Returns the component used as an horizontal ruler for the plan displayed by this component.
|
float[] |
getPieceOfFurnitureSizeInPlan(HomePieceOfFurniture piece)
Returns the size of the given piece of furniture in the horizontal plan.
|
float |
getPixelLength()
Returns the length in centimeters of a pixel with the current scale.
|
float |
getPrintPreferredScale(float preferredWidth,
float preferredHeight)
Returns the preferred scale to ensure it can be fully printed on the given print zone.
|
float |
getPrintPreferredScale(java.awt.Graphics graphics,
java.awt.print.PageFormat pageFormat)
Returns the preferred scale to print the plan component.
|
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.
|
boolean |
isFormatTypeSupported(ExportableView.FormatType formatType)
Returns
true if the plan component supports the given format type. |
boolean |
isFurnitureSizeInPlanSupported()
Returns
true if this component is able to compute the size of horizontally rotated furniture. |
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 g,
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(java.awt.Cursor cursor)
Sets the cursor of this component.
|
void |
setCursor(PlanView.CursorType cursorType)
Sets the cursor of this component.
|
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)
Sets properties edited in tool tip.
|
void |
setToolTipEditedPropertyValue(PlanController.EditableProperty toolTipEditedProperty,
java.lang.Object toolTipPropertyValue)
Sets the value of a property 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) |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIaddAncestorListener, 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, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, 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, updateadd, 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, validateTreeaction, 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, 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, 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, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCyclepublic MultipleLevelsPlanPanel(Home home, UserPreferences preferences, PlanController controller)
protected PlanView createPlanComponent(Home home, UserPreferences preferences, PlanController controller)
public void setTransferHandler(javax.swing.TransferHandler newHandler)
setTransferHandler in class javax.swing.JComponentpublic void setComponentPopupMenu(javax.swing.JPopupMenu popup)
setComponentPopupMenu in class javax.swing.JComponentpublic void addMouseMotionListener(java.awt.event.MouseMotionListener l)
addMouseMotionListener in class java.awt.Componentpublic void addMouseListener(java.awt.event.MouseListener l)
addMouseListener in class java.awt.Componentpublic void addFocusListener(java.awt.event.FocusListener l)
addFocusListener in class java.awt.Componentpublic java.lang.Object createTransferData(TransferableView.DataType dataType)
createTransferData in interface TransferableViewpublic boolean isFormatTypeSupported(ExportableView.FormatType formatType)
true if the plan component supports the given format type.isFormatTypeSupported in interface ExportableViewpublic void exportData(java.io.OutputStream out,
ExportableView.FormatType formatType,
java.util.Properties settings)
throws java.io.IOException
exportData in interface ExportableViewjava.io.IOExceptionpublic void setRectangleFeedback(float x0,
float y0,
float x1,
float y1)
setRectangleFeedback in interface PlanViewpublic void makeSelectionVisible()
makeSelectionVisible in interface PlanViewpublic void makePointVisible(float x,
float y)
x, y) is visible in the plan displayed by this component,
moving its scroll bars if needed.makePointVisible in interface PlanViewpublic float getScale()
public void setScale(float scale)
public void moveView(float dx,
float dy)
public float convertXPixelToModel(int x)
x converted in model coordinates space.convertXPixelToModel in interface PlanViewpublic float convertYPixelToModel(int y)
y converted in model coordinates space.convertYPixelToModel in interface PlanViewpublic int convertXModelToScreen(float x)
x converted in screen coordinates space.convertXModelToScreen in interface PlanViewpublic int convertYModelToScreen(float y)
y converted in screen coordinates space.convertYModelToScreen in interface PlanViewpublic float getPixelLength()
getPixelLength in interface PlanViewpublic float[][] getTextBounds(java.lang.String text,
TextStyle style,
float x,
float y,
float angle)
text displayed at
the point (x,y).getTextBounds in interface PlanViewpublic void setCursor(PlanView.CursorType cursorType)
public void setCursor(java.awt.Cursor cursor)
setCursor in class java.awt.Componentpublic java.awt.Cursor getCursor()
getCursor in class java.awt.Componentpublic void setToolTipFeedback(java.lang.String toolTipFeedback,
float x,
float y)
setToolTipFeedback in interface PlanViewtoolTipFeedback - the text displayed in the tool tip
or null to make tool tip disappear.public void setToolTipEditedProperties(PlanController.EditableProperty[] toolTipEditedProperties, java.lang.Object[] toolTipPropertyValues, float x, float y)
setToolTipEditedProperties in interface PlanViewpublic void setToolTipEditedPropertyValue(PlanController.EditableProperty toolTipEditedProperty, java.lang.Object toolTipPropertyValue)
setToolTipEditedPropertyValue in interface PlanViewpublic void deleteToolTipFeedback()
deleteToolTipFeedback in interface PlanViewpublic void setResizeIndicatorVisible(boolean visible)
setResizeIndicatorVisible in interface PlanViewpublic void setAlignmentFeedback(java.lang.Class<? extends Selectable> alignedObjectClass, Selectable alignedObject, float x, float y, boolean showPoint)
setAlignmentFeedback in interface PlanViewpublic void setAngleFeedback(float xCenter,
float yCenter,
float x1,
float y1,
float x2,
float y2)
setAngleFeedback in interface PlanViewpublic void setDraggedItemsFeedback(java.util.List<Selectable> draggedItems)
setDraggedItemsFeedback in interface PlanViewpublic void setDimensionLinesFeedback(java.util.List<DimensionLine> dimensionLines)
setDimensionLinesFeedback in interface PlanViewpublic void deleteFeedback()
deleteFeedback in interface PlanViewpublic boolean canImportDraggedItems(java.util.List<Selectable> items, int x, int y)
true if the given coordinates belong to the plan displayed by this component.canImportDraggedItems in interface PlanViewpublic float[] getPieceOfFurnitureSizeInPlan(HomePieceOfFurniture piece)
getPieceOfFurnitureSizeInPlan in interface PlanViewpublic boolean isFurnitureSizeInPlanSupported()
true if this component is able to compute the size of horizontally rotated furniture.isFurnitureSizeInPlanSupported in interface PlanViewpublic View getHorizontalRuler()
getHorizontalRuler in interface PlanViewpublic View getVerticalRuler()
getVerticalRuler in interface PlanViewpublic int print(java.awt.Graphics g,
java.awt.print.PageFormat pageFormat,
int pageIndex)
throws java.awt.print.PrinterException
print in interface java.awt.print.Printablejava.awt.print.PrinterExceptionpublic float getPrintPreferredScale(java.awt.Graphics graphics,
java.awt.print.PageFormat pageFormat)
public float getPrintPreferredScale(float preferredWidth,
float preferredHeight)
getPrintPreferredScale in interface PlanViewpreferredWidth - width of the zone in cmpreferredHeight - height of the zone in cm

© Copyright 2024 Space Mushrooms
Distributed under GNU General Public License