pl.netanel.swt.matrix
Interface Zone<X extends java.lang.Number,Y extends java.lang.Number>

Type Parameters:
X - indexing type for horizontal axis
Y - indexing type for vertical axis

public interface Zone<X extends java.lang.Number,Y extends java.lang.Number>

Constitutes a region of a matrix where a section from the vertical axis and a section from the horizontal axis intersect with each other.

Zone has painters to paint itself on the screen and listeners to respond to user gestures towards it.

See Also:
Section

Method Summary
 void addListener(int eventType, Listener listener)
          Adds the listener to the collection of listeners who will be notified when an event of the given type occurs.
 void addPainter(int index, Painter<X,Y> painter)
          Inserts the painter at the given index of the receiver's painters list.
 void addPainter(Painter<X,Y> painter)
          Adds the painter at the end of the receiver's painters list.
 void addSelectionListener(SelectionListener listener)
          Adds the listener to the collection of listeners who will be notified when a zone cell is selected by the user, by sending it one of the messages defined in the SelectionListener interface.
 void bind(int commandId, int eventType, int code)
          Binds the command to the user gesture specified by the event type and code.
 void bind(int commandId, int eventType, int code, int condition)
          Binds the command to the user gesture specified by the event type, code and an additional condition.
 Point computeSize(X indexX, Y indexY, int wHint, int hHint)
          Returns the preferred size of the cell.
 boolean contains(CellExtent<X,Y> cellExtent, X indexX, Y indexY)
           
 boolean containsLocation(int x, int y)
          Return true if the given matrix related coordinates are locatad within bounds of this zone, otherwise return false.
 Rectangle getBounds(Frozen frozenX, Frozen frozenY)
          Returns the rectangular boundaries of this zone in the specified freezing area.
 Rectangle getCellBounds(X indexX, Y indexY)
          Return rectangular bounds of the cell with the given coordinates.
 Matrix<X,Y> getMatrix()
          Returns the matrix to which the zone belongs.
 CellExtent<X,Y> getMerged(X indexX, Y indexY)
          Returns the merge scope of the given cell, where the CellExtent.getEndX() is the count of items in the horizontal direction and CellExtent.getEndY() is the count of items in the vertical direction.
 Cell<X,Y> getMergeLimit()
          Returns the maximum number of cells that can merged on both horizontal and vertical axis.
 Painter<X,Y> getPainter(int index)
          Returns the painter at the specified position in the receiver's list of painters.
 Painter<X,Y> getPainter(java.lang.String name)
          Returns a painter with the specified name, or null if the painters list does not contain such painter.
 int getPainterCount()
          Returns the number of the receiver's painters.
 Section<X> getSectionX()
          Returns the zone section horizontal axis.
 Section<Y> getSectionY()
          Returns the zone section at vertical axis.
 java.math.BigInteger getSelectedCount()
          Returns the number of selected cells in this zone.
 CellExtent<X,Y> getSelectedExtent()
          Returns selection index bounds.
 java.util.Iterator<CellExtent<X,Y>> getSelectedExtentIterator()
          Returns iterator for selected cell extents.
 java.util.Iterator<Cell<X,Y>> getSelectedIterator()
          Returns iterator for selected cells.
 java.math.BigInteger getSelectionCount()
          Deprecated. use getSelectedCount() instead
 Zone<X,Y> getUnchecked()
          Returns a no argument checking implementation for this zone.
 int indexOfPainter(java.lang.String name)
          Returns the index of a painter with the specified name in the list of the receiver's painters, or -1 if this list does not contain the element.
 boolean isMerged(X indexX, X countX, Y indexY, Y countY)
          Returns true if any cell in the given range is merged.
 boolean isMerged(X indexX, Y indexY)
          Returns true if the cell at given indexes is merged.
 boolean isSelected(X indexX, Y indexY)
          Returns true if the cell at given indexes is selected.
 boolean isSelectionEnabled()
          Returns true if selection is enabled, false otherwise.
 void removeListener(int eventType, Listener listener)
          Removes the listener from the collection of listeners who will be notified when an event of the given type occurs.
 Painter<X,Y> removePainter(int index)
          Removes the element at the specified position in the list of painters.
 boolean removePainter(Painter<X,Y> painter)
          Removes the specified element from this list, if it is present (optional operation).
 boolean removePainter(java.lang.String name)
          Removes a painter with the specified name from this list, if it is present (optional operation).
 void removeSelectionListener(SelectionListener listener)
          Removes the listener from the collection of listeners who will be notified when a zone cell is selected by the user.
 void replacePainter(Painter<X,Y> painter)
          Replaces the painter at the index of painter with the same name.
 void replacePainterPreserveStyle(Painter<X,Y> painter)
          Replaces the painter at the index of painter with the same name.
 void setMerged(java.lang.Iterable<CellExtent<X,Y>> iterable)
          Bulk merging.
 boolean setMerged(X indexX, X countX, Y indexY, Y countY, boolean state)
          Sets the merging state for the range of cells.
 void setMergeLimit(X limitX, Y limitY)
          Sets the maximum number of cells that can merged on both horizontal and vertical axis.
 void setPainter(int index, Painter<X,Y> painter)
          Replaces the painter at the given index of the receiver's painters list.
 void setSelected(X startX, X endX, Y startY, Y endY, boolean state)
          Sets the selection state for the range of cells.
 void setSelected(X indexX, Y indexY, boolean state)
          Sets the selection state for the specified cell.
 void setSelectedAll(boolean state)
          Sets the selection state for all the cells in this zone.
 void setSelectionEnabled(boolean enabled)
          Enables cell selection if the argument is true, or disables it otherwise.
 void unbind(int commandId, int eventType, int code)
          Removes the binding the command to the user gesture specified by the event type and code.
 void unbind(int commandId, int eventType, int code, int condition)
          Removes the binding the command to the user gesture specified by the event type and code.
 

Method Detail

getUnchecked

Zone<X,Y> getUnchecked()
Returns a no argument checking implementation for this zone. It may be useful for loop optimization, for example inside of Painter.paint(int, int, int, int) method.

Returns:
a no argument checking implementation for this zone

getSectionX

Section<X> getSectionX()
Returns the zone section horizontal axis.

Returns:
the zone section horizontal axis

getSectionY

Section<Y> getSectionY()
Returns the zone section at vertical axis.

Returns:
the zone section at vertical axis

getCellBounds

Rectangle getCellBounds(X indexX,
                        Y indexY)
Return rectangular bounds of the cell with the given coordinates. If the cell is not in the viewport or one of the indexes is null it return null.

Parameters:
indexX - cell index on the horizontal axis
indexY - cell index on the vertical axis
Returns:
rectangular bounds of the cell with the given coordinates.
Throws:
java.lang.IllegalArgumentException - if indexX or indexY is null.
java.lang.IndexOutOfBoundsException - if indexY is out of 0 ... this.getSectionX().getCount() bounds
java.lang.IndexOutOfBoundsException - if indexX is out of 0 ... this.getSectionY().getCount() bounds

getBounds

Rectangle getBounds(Frozen frozenX,
                    Frozen frozenY)
Returns the rectangular boundaries of this zone in the specified freezing area.

Parameters:
frozenX - frozen area on horizontal axis
frozenY - frozen area on vertical axis
Returns:
the rectangular boundaries of this zone

computeSize

Point computeSize(X indexX,
                  Y indexY,
                  int wHint,
                  int hHint)
Returns the preferred size of the cell.

The preferred size of a cell is the size that it would best be displayed at. The width hint and height hint arguments allow the caller to ask a cell questions such as "Given a particular width, how high does the control need to be to show all of the contents?" To indicate that the caller does not wish to constrain a particular dimension, the constant SWT.DEFAULT is passed for the hint.

The hints are not implemented yet for text wrap.

The size is maximum size returned by Painter.computeSize(Number, Number, int, int) of all painters of

Parameters:
indexX - cell index on the horizontal axis
indexY - cell index on the vertical axis
wHint - the width hint (can be SWT.DEFAULT)
hHint - the height hint (can be SWT.DEFAULT)
Returns:
the preferred size of the control

isSelectionEnabled

boolean isSelectionEnabled()
Returns true if selection is enabled, false otherwise.

Returns:
the selection enabled state

setSelectionEnabled

void setSelectionEnabled(boolean enabled)
Enables cell selection if the argument is true, or disables it otherwise.

Parameters:
enabled - the new selection ability state.

isSelected

boolean isSelected(X indexX,
                   Y indexY)
Returns true if the cell at given indexes is selected. Otherwise, false is returned.

indexX and indexY refer to the model, not the visual position of the item on the screen which can be altered by move and hide operations.

If one the parameters is null then the method returns true if any cell with the other index is selected

Parameters:
indexX - cell index on the horizontal axis
indexY - cell index on the vertical axis
Returns:
the selection state of the specified cell
Throws:
java.lang.IllegalArgumentException - only if both indexX and indexY are null.
java.lang.IndexOutOfBoundsException - if indexX is out of 0 ... this.getSectionY().getCount() bounds
java.lang.IndexOutOfBoundsException - if indexY is out of 0 ... this.getSectionX().getCount() bounds

setSelected

void setSelected(X startX,
                 X endX,
                 Y startY,
                 Y endY,
                 boolean state)
Sets the selection state for the range of cells.

startX,endX, startY and endY numbers are item indexes in the model, not the visual position of the item on the screen which can be altered by move and hide operations.

Parameters:
startX - first index of the range of column items
endX - last index of the range of column items
startY - first index of the range of row items
endY - last index of the range of row items
state - the new selection state
Throws:
java.lang.IllegalArgumentException - if startX or endX or startY or endY is null.
java.lang.IllegalArgumentException - if startX is greater then endX or startY is greater then endY.
java.lang.IndexOutOfBoundsException - if startX or endX is out of 0 ... this.getSectionX().getCount() bounds
java.lang.IndexOutOfBoundsException - if startY or endY is out of 0 ... this.getSectionY().getCount() bounds

setMerged

boolean setMerged(X indexX,
                  X countX,
                  Y indexY,
                  Y countY,
                  boolean state)
Sets the merging state for the range of cells. If the given range of cell contains merged cells the merging will be removed for all of those cells. Otherwise the cells will be merged.

indexX and indexY numbers are item indexes in the model, not the visual position of the item on the screen which can be altered by move and hide operations.

Parameters:
indexX - index of the column item from which the merging starts
countX - quantity of column items being merged
indexY - index of the row item from which the merging starts
countY - quantity of row items being merged
state - the new merging state
Returns:
false if overlapping merging has been removed, true if merged without conflict
Throws:
java.lang.IllegalArgumentException - if indexX or countX or indexY or countY is null.
java.lang.IndexOutOfBoundsException - if indexX or countX is out of 0 ... this.getSectionX().getCount() bounds
java.lang.IndexOutOfBoundsException - if indexY or countY is out of 0 ... this.getSectionY().getCount() bounds

setMerged

void setMerged(java.lang.Iterable<CellExtent<X,Y>> iterable)
Bulk merging. Clears all the merged cells and adds a new set of merged set without any validation for maximum performance.

Parameters:
iterable - returns iterator over CellExtent type of items where getStartX contains the start index of the merged fragment on the X axis getEndX contains the count of merged cells on the X axis getStartY contains the start index of the merged fragment on the Y axis getEndY contains the count of merged cells on the Y axis

getMerged

CellExtent<X,Y> getMerged(X indexX,
                          Y indexY)
Returns the merge scope of the given cell, where the CellExtent.getEndX() is the count of items in the horizontal direction and CellExtent.getEndY() is the count of items in the vertical direction.

indexX and indexY refer to the model, not the visual position of the item on the screen which can be altered by move and hide operations.

Parameters:
indexX - cell index on the horizontal axis
indexY - cell index on the vertical axis
Returns:
the merge scope of the given cell

isMerged

boolean isMerged(X indexX,
                 Y indexY)
Returns true if the cell at given indexes is merged. Otherwise, false is returned.

indexX and indexY refer to the model, not the visual position of the item on the screen which can be altered by move and hide operations.

Parameters:
indexX - cell index on the horizontal axis
indexY - cell index on the vertical axis
Returns:
the merge state of the specified cell
Throws:
java.lang.IllegalArgumentException - if indexX or countX or indexY or countY is null.
java.lang.IndexOutOfBoundsException - if indexX or countX is out of 0 ... this.getSectionX().getCount() bounds
java.lang.IndexOutOfBoundsException - if indexY or countY is out of 0 ... this.getSectionY().getCount() bounds

isMerged

boolean isMerged(X indexX,
                 X countX,
                 Y indexY,
                 Y countY)
Returns true if any cell in the given range is merged. Otherwise, false is returned.

indexX and indexY refer to the model, not the visual position of the item on the screen which can be altered by move and hide operations.

Parameters:
indexX - index of the column item from which the merging starts
countX - quantity of column items being merged
indexY - index of the row item from which the merging starts
countY - quantity of row items being merged
Returns:
true if any cell in the given range is merged.
Throws:
java.lang.IndexOutOfBoundsException - if startX or endX is out of 0 ... this.getSectionX().getCount() bounds
java.lang.IndexOutOfBoundsException - if startY or endY is out of 0 ... this.getSectionY().getCount() bounds

getMergeLimit

Cell<X,Y> getMergeLimit()
Returns the maximum number of cells that can merged on both horizontal and vertical axis.

Returns:
the maximum number of cells that can merged on both horizontal and vertical axis

setMergeLimit

void setMergeLimit(X limitX,
                   Y limitY)
Sets the maximum number of cells that can merged on both horizontal and vertical axis.

It is introduced to prevent performance problems with layout calculation which in case of merged cells must go beyond viewport area.

Parameters:
limitX - maximum number of cells that can be merged on horizontal axis
limitY - maximum number of cells that can be merged on vertical axis

setSelected

void setSelected(X indexX,
                 Y indexY,
                 boolean state)
Sets the selection state for the specified cell.

indexX and indexY refer to the model, not the visual position of the item on the screen which can be altered by move and hide operations.

Ranges of cells should be set selected by setSelected(Number, Number, Number, Number, boolean) to achieve the best efficiency.

Parameters:
indexX - cell index on the horizontal axis
indexY - cell index on the vertical axis
Throws:
java.lang.IllegalArgumentException - if indexX or indexY is null.
java.lang.IndexOutOfBoundsException - if indexX is out of 0 ... this.getSectionY().getCount() bounds
java.lang.IndexOutOfBoundsException - if indexY is out of 0 ... this.getSectionX().getCount() bounds

setSelectedAll

void setSelectedAll(boolean state)
Sets the selection state for all the cells in this zone.

Parameters:
state - the new selection state

getSelectedCount

java.math.BigInteger getSelectedCount()
Returns the number of selected cells in this zone.

Returns:
the number of selected cells in this zone

getSelectionCount

@Deprecated
java.math.BigInteger getSelectionCount()
Deprecated. use getSelectedCount() instead

Returns the number of selected cells in this zone.

If the cell selection is disabled the it always returns a BigInteger with zero value.

Returns:
BigInteger with the count of selected cells

getSelectedIterator

java.util.Iterator<Cell<X,Y>> getSelectedIterator()
Returns iterator for selected cells. First number in the array returned by the Iterator.next() method is a vertical axis index, the second one is a horizontal axis index.

indexX and indexY refer to the model, not the visual position of the item on the screen which can be altered by move and hide operations.

Warning iterating index by index over large extents may cause a performance problem.


getSelectedExtentIterator

java.util.Iterator<CellExtent<X,Y>> getSelectedExtentIterator()
Returns iterator for selected cell extents. First two numbers in the array returned by the Iterator.next() method define start and end of a vertical axis extent, the second two the start and end of a horizontal axis extent.

indexX and indexY refer to the model, not the visual position of the item on the screen which can be altered by move and hide operations.


getSelectedExtent

CellExtent<X,Y> getSelectedExtent()
Returns selection index bounds. It's a minimal range covering all the selected cells. It return null if nothing is selected.

For example: if only two cells (0,0) and (2,1) are selected with Ctrl+Click than this method will return range of six cells (0-2, 0-1).

Returns:
selection index bounds

bind

void bind(int commandId,
          int eventType,
          int code)
Binds the command to the user gesture specified by the event type and code. Code is a logical OR of key, state mask and mouse button codes.

Parameters:
commandId - identifier of a command from Matrix
eventType - event type from SWT class
code - || combination of keyCode, button and stateMask, alternatively it can equal to Matrix.PRINTABLE_CHARS in order to be triggered by typing
See Also:
unbind(int, int, int)

bind

void bind(int commandId,
          int eventType,
          int code,
          int condition)
Binds the command to the user gesture specified by the event type, code and an additional condition. Code is a logical OR of key, state mask and mouse button codes. Condition is a logical OR of Matrix.GESTURE_ON_SELECTED and Matrix.GESTURE_ON_RESIZE_AREA

Parameters:
commandId - identifier of a command from Matrix
eventType - event type from SWT class
code - || combination of keyCode, button and stateMask, alternatively it can equal to Matrix.PRINTABLE_CHARS in order to be triggered by typing
condition - || combination of gesture conditions Matrix.GESTURE_ON_SELECTED and Matrix.GESTURE_ON_RESIZE_AREA
See Also:
unbind(int, int, int)

unbind

void unbind(int commandId,
            int eventType,
            int code)
Removes the binding the command to the user gesture specified by the event type and code. Code is a logical OR of key, state mask and mouse button codes.

Parameters:
commandId - identifier of a command from Matrix
eventType - event type from SWT class
code - || combination of keyCode, button and stateMask
See Also:
bind(int, int, int)

unbind

void unbind(int commandId,
            int eventType,
            int code,
            int condition)
Removes the binding the command to the user gesture specified by the event type and code. Code is a logical OR of key, state mask and mouse button codes.

Parameters:
commandId - identifier of a command from Matrix
eventType - event type from SWT class
code - || combination of keyCode, button and stateMask
condition - || combination of gesture conditions Matrix.GESTURE_ON_SELECTED and Matrix.GESTURE_ON_RESIZE_AREA
See Also:
bind(int, int, int)

addSelectionListener

void addSelectionListener(SelectionListener listener)
Adds the listener to the collection of listeners who will be notified when a zone cell is selected by the user, by sending it one of the messages defined in the SelectionListener interface.

The selection event is not emitted by the zone API methods that are responsible for selection and deselection of items. It can only be triggered by another SWT event bound to the selection command.

widgetSelected is called when the axis item is selected widgetDefaultSelected is not called.

Parameters:
listener - the listener which should be notified when the cells are selected by the user
Throws:
java.lang.IllegalArgumentException -
  • ERROR_NULL_ARGUMENT - if the listener is null
SWTException -
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
See Also:
SelectionListener, SelectionEvent, removeSelectionListener(SelectionListener)

removeSelectionListener

void removeSelectionListener(SelectionListener listener)
Removes the listener from the collection of listeners who will be notified when a zone cell is selected by the user.

Parameters:
listener - the listener which should no longer be notified
Throws:
java.lang.IllegalArgumentException -
  • ERROR_NULL_ARGUMENT - if the listener is null
SWTException -
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
See Also:
SelectionListener, addSelectionListener(SelectionListener)

addListener

void addListener(int eventType,
                 Listener listener)
Adds the listener to the collection of listeners who will be notified when an event of the given type occurs. When the event does occur in the zone, the listener is notified by sending it the handleEvent() message. The event type is one of the event constants defined in class SWT. The zone for the mouse event is identified by mouse location and the zone for key events is identified by the focus items on the axises. The coordinates of the mouse event are Matrix widget related and are not translated to be related to the zone location.

The supported event types are: SWT#MouseDoubleClick, SWT#MouseDown, SWT#MouseUp, SWT#MouseMove, SWT#MouseEnter, SWT#MouseExit, SWT#KeyDown, SWT#KeyUp

Parameters:
eventType - the type of event to listen for.
listener - the listener which should be notified when the event occurs
Throws:
java.lang.IllegalArgumentException -
  • ERROR_NULL_ARGUMENT - if the listener is null
SWTException -
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
See Also:
Listener, SWT, removeListener(int, Listener)

removeListener

void removeListener(int eventType,
                    Listener listener)
Removes the listener from the collection of listeners who will be notified when an event of the given type occurs. The event type is one of the event constants defined in class SWT.

Parameters:
eventType - the type of event to listen for
listener - the listener which should no longer be notified
Throws:
java.lang.IllegalArgumentException -
  • ERROR_NULL_ARGUMENT - if the listener is null
SWTException -
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
See Also:
Listener, SWT, addListener(int, Listener)

addPainter

void addPainter(Painter<X,Y> painter)
Adds the painter at the end of the receiver's painters list.

Parameters:
painter - the painter to be added

addPainter

void addPainter(int index,
                Painter<X,Y> painter)
Inserts the painter at the given index of the receiver's painters list.

Parameters:
index - at which the specified painter is to be inserted
painter - painter to be inserted
Throws:
java.lang.IndexOutOfBoundsException - if the index is out of range (index < 0 || index >= getPainterCount())
java.lang.IllegalArgumentException - if the painter is null
java.lang.IllegalArgumentException - if the painter's name already exists in the collection of painters.

setPainter

void setPainter(int index,
                Painter<X,Y> painter)
Replaces the painter at the given index of the receiver's painters list.

Parameters:
index - index of the element to replace
painter - painter to be stored at the specified position
Throws:
java.lang.IndexOutOfBoundsException - if the index is out of range (index < 0 || index >= getPainterCount()) *
java.lang.IllegalArgumentException - if the painter is null
java.lang.IllegalArgumentException - if the painter's name already exists in the collection of painters.

replacePainter

void replacePainter(Painter<X,Y> painter)
Replaces the painter at the index of painter with the same name. If a painter with the specified name does not exist, then the new painter is added at the end.

Parameters:
painter - painter to replace a painter with the same name
Throws:
java.lang.IllegalArgumentException - if the painter is null

replacePainterPreserveStyle

void replacePainterPreserveStyle(Painter<X,Y> painter)
Replaces the painter at the index of painter with the same name. If a painter with the specified name does not exist, then the new painter is added at the end.

The new painter inherits the style from the painter that's being replaced. This helps for example to customize text in the cells without the need to re-apply all the styling data, like background color, selection colors, etc.

Parameters:
painter - painter to replace a painter with the same name
Throws:
java.lang.IllegalArgumentException - if the painter is null

removePainter

Painter<X,Y> removePainter(int index)
Removes the element at the specified position in the list of painters. Shifts any subsequent painters to the left (subtracts one from their indices). Returns the painter that was removed from the list.

Parameters:
index - the index of the painter to be removed
Returns:
the painter previously at the specified position
Throws:
java.lang.IndexOutOfBoundsException - if the index is out of range (index < 0 || index >= getPainterCount())
See Also:
Painter.NAME_CELLS

removePainter

boolean removePainter(Painter<X,Y> painter)
Removes the specified element from this list, if it is present (optional operation). If this list does not contain the element, it is unchanged.

Parameters:
painter - element to be removed from this list, if present
Returns:
true if this list contained the specified element
Throws:
java.lang.ClassCastException - if the type of the specified element is incompatible with this list (optional)
java.lang.IllegalArgumentException - if the painter is null
See Also:
Painter.NAME_CELLS

removePainter

boolean removePainter(java.lang.String name)
Removes a painter with the specified name from this list, if it is present (optional operation). If this list does not contain the element, it is unchanged.

Parameters:
name - the name of the painter to be removed from this list, if present
Returns:
true if this list contained the specified element
Throws:
java.lang.ClassCastException - if the type of the specified element is incompatible with this list (optional)
java.lang.IllegalArgumentException - if the painter is null
See Also:
Painter.NAME_CELLS

indexOfPainter

int indexOfPainter(java.lang.String name)
Returns the index of a painter with the specified name in the list of the receiver's painters, or -1 if this list does not contain the element.

Parameters:
name - painter name to search for
Returns:
the index of a painter with the specified name
Throws:
java.lang.IllegalArgumentException - if the name is null

getPainter

Painter<X,Y> getPainter(java.lang.String name)
Returns a painter with the specified name, or null if the painters list does not contain such painter.

Parameters:
name - painter name to search for
Returns:
the index of a painter with the specified name
Throws:
java.lang.IllegalArgumentException - if the name is null

getPainterCount

int getPainterCount()
Returns the number of the receiver's painters.

Returns:
the number of the receiver's painters

getPainter

Painter<X,Y> getPainter(int index)
Returns the painter at the specified position in the receiver's list of painters.

Parameters:
index - index of the painter to return
Returns:
the painter at the specified position in the receiver's list of painters.
Throws:
java.lang.IndexOutOfBoundsException - if the index is out of range (index < 0 || index >= getPainterCount())

getMatrix

Matrix<X,Y> getMatrix()
Returns the matrix to which the zone belongs.

Returns:
the matrix to which the zone belongs

contains

boolean contains(CellExtent<X,Y> cellExtent,
                 X indexX,
                 Y indexY)

containsLocation

boolean containsLocation(int x,
                         int y)
Return true if the given matrix related coordinates are locatad within bounds of this zone, otherwise return false.

Returns:
true if the given coordinates are locatad within bounds of this zone


Copyright © 2011 netanel.pl. All Rights Reserved.