com.swfm.mica.widgets
Class MiTableLayout

java.lang.Object
  extended bycom.swfm.mica.core.MiPart
      extended bycom.swfm.mica.core.MiContainer
          extended bycom.swfm.mica.layouts.MiLayout
              extended bycom.swfm.mica.widgets.MiTableLayout
All Implemented Interfaces:
MiiActionTypes, MiiAttributeTypes, MiiCopyable, MiiDragAndDropParticipant, MiiEventTypes, MiiLayout, MiiNames, MiiPropertyTypes, MiiTypes

public class MiTableLayout
extends MiLayout

Version:
%I% %G%
Author:
Michael L. Davis

Field Summary
                 
Constructor Summary
MiTableLayout()
           
 
Method Summary
 void calcMinimumSize(MiSize size)
          Gets the minimum size of this MiPart.
 void calcPreferredSize(MiSize size)
          Gets the preferred size of this MiPart.
 MiBounds getCellBounds(int rowNumber, int columnNumber, MiBounds bounds)
           
 MiBounds getColumnBounds(int columnNumber, int firstRow, int lastRow, MiBounds bounds)
           
 double getEmptyColumnWidth()
           
 double getEmptyRowHeight()
           
 MiBounds getRowBounds(int rowNumber, int firstColumn, int lastColumn, MiBounds bounds)
           
 MiBounds getSingleColumnBounds(int columnNumber, int firstRow, int lastRow, MiBounds bounds)
           
 MiBounds getSingleRowBounds(int rowNumber, int firstColumn, int lastColumn, MiBounds bounds)
           
 boolean isIndependantOfTargetPosition()
          Gets whether this layout is not dependent on the position of the target.
 void setEmptyColumnWidth(double width)
          When all columns are empty this value is used to calculate the preferred width (by multiplying the table's preferredNumberOfDisplayedColumns times this value).
 void setEmptyRowHeight(double height)
          When all rows are empty this value is used to calculate the preferred height (by multiplying the table's preferredNumberOfDisplayedRows times this value).
 void setTarget(MiPart target)
          Sets the target to lay out.
 
Methods inherited from class com.swfm.mica.layouts.MiLayout
copy, determinesPreferredAndMinimumSizes, getAlleyHSpacing, getAlleyMargins, getAlleyVSpacing, getCellMargins, getCellMargins, getElementHJustification, getElementHSizing, getElementVJustification, getElementVSizing, getInsetMargins, getInsetMargins, getLastElementJustification, getPropertyDescriptions, getPropertyValue, getTarget, getUniqueElementIndex, getUniqueElementSizing, isEnabled, isScalingOfPartsWhenBoundsChangesHandledDuringLayout, layoutParts, makeCopy, setAlleyHSpacing, setAlleySpacing, setAlleyVSpacing, setCellMargins, setCellMargins, setElementHJustification, setElementHSizing, setElementJustification, setElementSizing, setElementVJustification, setElementVSizing, setEnabled, setInsetMargins, setInsetMargins, setLastElementJustification, setPropertyValue, setScalingOfPartsWhenBoundsChangesHandledDuringLayout, setUniqueElementIndex, setUniqueElementSizing, toString
 
Methods inherited from class com.swfm.mica.core.MiContainer
appendPart, containsPart, deepCopy, doImport, getIndexOfPart, getIntersectionWithLine, getKeepConnectionsBelowNodes, getNumberOfParts, getPart, getPart, getSupportedImportFormats, hasEventHandlers, hasValidCachedEventHandlerInfo, insertPart, invalidateCachedEventHandlerInfo, isContainerOf, isContainerOf, isContainerOfWithAttachments, pick, pickDeepListContents, pickObject, removeAllParts, removePart, removePart, setKeepConnectionsBelowNodes, setPart, translate
 
Methods inherited from class com.swfm.mica.core.MiPart
_reCalcBounds, _render, _replaceBounds, _setContainer, _setDrawManager, _setValidatingLayout, appendActionHandler, appendActionHandler, appendActionHandler, appendActionHandler, appendActionHandler, appendAttachment, appendAttachment, appendCommandHandler, appendCommandHandler, appendCommandHandler, appendConnection, appendContainer, appendEventHandler, appendItem, appendPoint, appendPoint, applyCustomLookAndFeel, containsItem, containsOpaqueRectangles, copy, deleteAllConnections, deleteAllParts, deleteSelf, dispatchAction, dispatchAction, dispatchAction, dispatchActionRequest, dispatchActionRequest, dispatchActionRequest, dispatchEvent, doExport, draw, drawNow, drawNow, flip, flip, freeAccessLock, get1DShapeStrokeBackgroundColor, get1DShapeStrokesFilled, getAccessLock, getActionHandler, getActionsGenerated, getActionsLocallyGenerated, getActionsRequestedFromParts, getAfterRenderer, getAlphaCompositeRenderMode, getAnnotationPointManager, getAssociatedParts, getAttachment, getAttachment, getAttachmentMargins, getAttachments, getAttributeLockMask, getAttributePublicMask, getAttributes, getAttributeValue, getBackgroundColor, getBackgroundImage, getBackgroundRenderer, getBackgroundTile, getBalloonHelp, getBeforeRenderer, getBlackColor, getBorderHiliteColor, getBorderHiliteWidth, getBorderLook, getBorderRenderer, getBounds, getBounds, getCenter, getCenter, getCenterOfRotation, getCenterX, getCenterY, getColor, getConnection, getConnectionPointManager, getContainer, getContainerRequestedActions, getContainingEditor, getContainingWindow, getContextCursor, getContextMenu, getContextMenu, getControlPointManager, getCustomLookAndFeels, getCustomLookAndFeels, getDarkColor, getDeepConnection, getDeepConnection, getDeepConnections, getDeeplyInvalidateAreas, getDefaultAttributes, getDialogHelp, getDoubleBuffer, getDragAndDropBehavior, getDrawBounds, getDrawManager, getEventHandler, getEventHandler, getEventHandlerWithClass, getEventHandlingDisabledByContainer, getEventHandlingEnabled, getFlipped, getFont, getFontHorizontalJustification, getFontPointSize, getFontVerticalJustification, getHasBorderHilite, getHasShadow, getHeight, getID, getIncomingInvalidLayoutNotificationsEnabled, getIndexOfItem, getInnerBounds, getInnerBounds, getInvalidAreaNotificationsEnabled, getInvalidLayoutNotificationsEnabled, getItem, getItem, getKeyFocusTraversalGroup, getLayout, getLayoutManipulator, getLightColor, getLineEndSize, getLineEndsRenderer, getLineEndsSizeFnOfLineWidth, getLineEndStyle, getLineStartSize, getLineStartStyle, getLineStyle, getLineWidth, getLocallyRequestedEventTypes, getManipulator, getMargins, getMaximumHeight, getMaximumWidth, getMinimumHeight, getMinimumPickAreaSize, getMinimumSize, getMinimumWidth, getName, getNumberOfActionHandlers, getNumberOfAttachments, getNumberOfConnections, getNumberOfContainers, getNumberOfDeepConnections, getNumberOfEventHandlers, getNumberOfItems, getNumberOfPoints, getNumberOfResources, getOutgoingInvalidLayoutNotificationsEnabled, getPoint, getPoint, getPointEntryAngle, getPointExitAngle, getPointX, getPointY, getPreferredSize, getPrototypeManipulator, getRelativeLocation, getResource, getResourceName, getRootWindow, getRotation, getSelectionGraphics, getShadowColor, getShadowDirection, getShadowLength, getShadowRenderer, getShadowShape, getShadowStyle, getSize, getSnapPointManager, getStatusHelp, getSupportedExportFormats, getThisOrPartHasInvalidArea, getToolHintHelp, getTotalNumberOfPartsCreated, getTransform, getTransparency, getValidatingLayout, getVisibilityAnimator, getWhiteColor, getWidth, getWriteMode, getXmax, getXmin, getXorColor, getYmax, getYmin, hasAttachment, hasAttribute, hasEnterKeyFocus, hasEventHandler, hasFixedAspectRatio, hasFixedHeight, hasFixedWidth, hasKeyboardFocus, hasMouseFocus, hasOverriddenMinimumSize, hasOverriddenPreferredSize, hasProperty, hasTotallyInvalidArea, hasValidLayout, insertActionHandler, insertActionHandler, insertActionHandler, insertConnection, insertContainer, insertEventHandler, insertItem, insertPoint, insertPoint, invalidateArea, invalidateArea, invalidateLayout, isAcceptingEnterKeyFocus, isAcceptingKeyboardFocus, isAcceptingMouseFocus, isAcceptingTabKeys, isActionDispatchingEnabled, isConnectable, isConnectedTo, isCopyable, isCopyableAsPartOfCopyable, isDeletable, isDoubleBuffered, isDragAndDropSource, isDragAndDropTarget, isFilled, isFontBold, isFontItalic, isFontUnderlined, isHidden, isMovable, isOpaqueRectangle, isPickable, isPickableWhenTransparent, isPrintable, isSavable, isSelectable, isSelected, isSensitive, isShowing, isSnappable, isUngroupable, isValidConnectionDestination, isValidConnectionSource, isVisible, makeImageFromArea, makeLayoutManipulator, makeManipulator, optimizedInvalidateArea, optimizedInvalidateDrawBoundsArea, overrideAttributes, overrideEventHandlingDisabledByContainer, packLayout, pickDeepList, preRenderToDoubleBuffer, refreshBounds, refreshLookAndFeel, refreshLookAndFeel, removeActionHandler, removeActionHandler, removeActionHandlers, removeAllActionHandlers, removeAllAttachments, removeAllConnections, removeAllEventHandlers, removeAllItems, removeAllManipulators, removeAttachment, removeAttachment, removeCommandHandler, removeCommandHandler, removeConnection, removeConnection, removeContainer, removeContainer, removeEventHandler, removeFromAllContainers, removeItem, removeItem, removePoint, removeResource, removeSelf, replaceDrawBounds, replaceSelf, requestEnterKeyFocus, requestKeyboardFocus, rotate, rotate, rotateTo, scale, scale, scale, select, set1DShapeStrokeBackgroundColor, set1DShapeStrokesFilled, setAcceptingEnterKeyFocus, setAcceptingKeyboardFocus, setAcceptingMouseFocus, setAcceptingTabKeys, setActionDispatchingEnabled, setAfterRenderer, setAlphaCompositeRenderMode, setAnnotationPointManager, setAttachmentDrawnAfter, setAttachmentMargins, setAttachmentsVisibility, setAttributeLockMask, setAttributePublicMask, setAttributes, setAttributeValue, setAttributeValue, setAttributeValue, setAttributeValue, setAttributeValue, setBackgroundColor, setBackgroundColor, setBackgroundImage, setBackgroundRenderer, setBackgroundTile, setBalloonHelp, setBalloonHelpMessage, setBeforeRenderer, setBlackColor, setBorderHiliteColor, setBorderHiliteWidth, setBorderLook, setBorderRenderer, setBounds, setBounds, setCenter, setCenter, setCenterX, setCenterY, setColor, setColor, setConnectable, setConnectionPointManager, setContextCursor, setContextMenu, setControlPointManager, setCopyable, setCopyableAsPartOfCopyable, setCustomLookAndFeels, setCustomLookAndFeels, setDarkColor, setDeeplyInvalidateAreas, setDefaultAttributes, setDeletable, setDialogHelp, setDialogHelpMessage, setDoubleBuffer, setDoubleBuffered, setDragAndDropBehavior, setEventHandlingEnabled, setFilled, setFixedAspectRatio, setFixedHeight, setFixedWidth, setFont, setFontBold, setFontHorizontalJustification, setFontItalic, setFontPointSize, setFontUnderlined, setFontVerticalJustification, setHasBorderHilite, setHasShadow, setHeight, setHidden, setIncomingInvalidLayoutNotificationsEnabled, setInvalidAreaNotificationsEnabled, setInvalidLayoutNotificationsEnabled, setIsDragAndDropSource, setIsDragAndDropTarget, setIsOpaqueRectangle, setItem, setKeyFocusTraversalGroup, setLayout, setLightColor, setLineEndSize, setLineEndSizeFnOfLineWidth, setLineEndsRenderer, setLineEndStyle, setLineStartSize, setLineStartStyle, setLineStyle, setLineWidth, setMargins, setMaximumHeight, setMaximumWidth, setMinimumHeight, setMinimumPickAreaSize, setMinimumSize, setMinimumWidth, setMouseFocus, setMovable, setName, setNumberOfPoints, setOutgoingInvalidLayoutNotificationsEnabled, setPickable, setPickableWhenTransparent, setPoint, setPoint, setPreferredSize, setPrintable, setPropertyValues, setPrototypeManipulator, setResource, setSavable, setSelectable, setSelectionGraphics, setSensitive, setShadowColor, setShadowDirection, setShadowLength, setShadowRenderer, setShadowStyle, setSize, setSize, setSnappable, setSnapPointManager, setStatusHelp, setStatusHelpMessage, setSupportedImportFormats, setToolHintHelp, setToolHintMessage, setTransparency, setTransparency, setUngroupable, setVisibilityAnimator, setVisible, setWhiteColor, setWidth, setWriteMode, setXmax, setXmin, setXorColor, setYmax, setYmin, supportsImportOfSpecificInstance, translate, translate, translatePoint, validateLayout, validatePropertyValue, waitUntilRedrawn
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.swfm.mica.layouts.MiiLayout
getMinimumSize, getPreferredSize, invalidateLayout
 

Constructor Detail

MiTableLayout

public MiTableLayout()
Method Detail

setTarget

public void setTarget(MiPart target)
Sets the target to lay out.

Specified by:
setTarget in interface MiiLayout
Overrides:
setTarget in class MiLayout
Parameters:
target - the target to lay out

setEmptyRowHeight

public void setEmptyRowHeight(double height)
When all rows are empty this value is used to calculate the preferred height (by multiplying the table's preferredNumberOfDisplayedRows times this value). When all rows are not empty the height of the first row is used for this calculation.


getEmptyRowHeight

public double getEmptyRowHeight()

setEmptyColumnWidth

public void setEmptyColumnWidth(double width)
When all columns are empty this value is used to calculate the preferred width (by multiplying the table's preferredNumberOfDisplayedColumns times this value). When all columns are not empty the width of the first column is used for this calculation.


getEmptyColumnWidth

public double getEmptyColumnWidth()

getSingleRowBounds

public MiBounds getSingleRowBounds(int rowNumber,
                                   int firstColumn,
                                   int lastColumn,
                                   MiBounds bounds)

getSingleColumnBounds

public MiBounds getSingleColumnBounds(int columnNumber,
                                      int firstRow,
                                      int lastRow,
                                      MiBounds bounds)

getRowBounds

public MiBounds getRowBounds(int rowNumber,
                             int firstColumn,
                             int lastColumn,
                             MiBounds bounds)

getColumnBounds

public MiBounds getColumnBounds(int columnNumber,
                                int firstRow,
                                int lastRow,
                                MiBounds bounds)

getCellBounds

public MiBounds getCellBounds(int rowNumber,
                              int columnNumber,
                              MiBounds bounds)

isIndependantOfTargetPosition

public boolean isIndependantOfTargetPosition()
Description copied from class: MiLayout
Gets whether this layout is not dependent on the position of the target. Most layouts return true. Layouts that support relative contraints (e.g. MiPolyConstraint) return false because of their dependance on their target relative to another.

Specified by:
isIndependantOfTargetPosition in interface MiiLayout
Overrides:
isIndependantOfTargetPosition in class MiLayout
Returns:
true if not dependent

calcMinimumSize

public void calcMinimumSize(MiSize size)
Description copied from class: MiContainer
Gets the minimum size of this MiPart. Override this, if desired, as it implements the core functionality. The default behavior is to: return the minimum size as determined by the layout assigned to this container or if only one part in this container, return it's minimum size or if no parts are in this container, return what the super class returns or return the union of all minimum sizes of all parts of this container

Overrides:
calcMinimumSize in class MiContainer
Parameters:
size - the (returned) minimum size
See Also:
MiPart.getMinimumSize(com.swfm.mica.core.MiSize)

calcPreferredSize

public void calcPreferredSize(MiSize size)
Description copied from class: MiContainer
Gets the preferred size of this MiPart. Override this, if desired, as it implements the core functionality. The default behavior is to: return the preferred size as determined by the layout assigned to this container or if only one part in this container, return it's preferred size or if no parts are in this container, return the current size of this container (or zero if this has reversed bounds). or return the union of all preferred sizes of all parts of this container at their present location

Overrides:
calcPreferredSize in class MiContainer
Parameters:
size - the (returned) preferred size
See Also:
MiPart.getPreferredSize(com.swfm.mica.core.MiSize)