public class IlpShelfItemPosition extends Object implements IlpPosition, Cloneable
Constructor and Description |
---|
IlpShelfItemPosition()
Creates a new position.
|
IlpShelfItemPosition(IlpShelfItemPosition pos)
Copies a position.
|
IlpShelfItemPosition(IlvRect rect)
Creates a new position by copying an existing one.
|
IlpShelfItemPosition(int slotX,
int slotY)
Creates a new position with a default span.
|
IlpShelfItemPosition(int slotX,
int slotY,
double spanX,
double spanY)
Creates a new position based on given information.
|
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Creates and returns a copy of a given
IlpShelfItemPosition
object. |
boolean |
equals(Object pos)
Compares the position to the given object.
|
int |
getSlotIndex()
Deprecated.
Please use
getXIndex instead. |
double |
getSlotSpan()
Deprecated.
Please use
getXSpan instead. |
int |
getXIndex()
Retrieves the
xIndex attribute. |
double |
getXSpan()
Retrieves the
xSpan attribute. |
int |
getYIndex()
Retrieves the
yIndex attribute. |
double |
getYSpan()
Retrieves the
ySpan attribute. |
int |
hashCode()
Returns a hash code value for the object.
|
void |
setXIndex(int index)
Sets the
xIndex attribute. |
void |
setXSpan(double span)
Sets the
xSpan attribute. |
void |
setYIndex(int index)
Sets the
yIndex attribute. |
void |
setYSpan(double span)
Sets the
ySpan attribute. |
String |
toString()
Converts the object into a human-readable format.
|
public IlpShelfItemPosition()
public IlpShelfItemPosition(IlpShelfItemPosition pos)
pos
- The position to be copied.public IlpShelfItemPosition(int slotX, int slotY)
The spanX and spanY are 1.
slotX
- The slot index for the X axis.slotY
- The slot index for the Y axis.public IlpShelfItemPosition(int slotX, int slotY, double spanX, double spanY)
A shelf is composed of a matrix of slots. When a shelf item occupies a part of a slot or more than one slot, it can be positioned by reference to the matrix. The shelf item position gives the indexes for the matrix and how many slots are occupied through X and Y axes.
For example, if spanX == 1
, the shelf item occupies
one slot only along the X axis. If spanY == 2
, the
shelf item occupies 2 slots along the Y axis. Using these
parameters, you could also position an item to occupy half a slot.
slotX
- The slot index for the X axis.slotY
- The slot index for the Y axis.spanX
- The span in the matrix in the X orientation of the slots.spanY
- The span in the matrix in the Y orientation of the slots.public IlpShelfItemPosition(IlvRect rect)
The position to be copied is given in a rectangle where
the x
coordinate corresponds to
slotX
; the y
coordinate corresponds to
slotY
; the width
corresponds to
spanX
and the height
corresponds
to spanY
.
rect
- The copied position.public int getXIndex()
xIndex
attribute.xIndex
attribute.public void setXIndex(int index)
xIndex
attribute.index
- The new value for the xIndex
attribute.public int getYIndex()
yIndex
attribute.yIndex
attribute.public void setYIndex(int index)
yIndex
attribute.index
- The new value for the yIndex
attribute.public double getXSpan()
xSpan
attribute.xSpan
attribute.public void setXSpan(double span)
xSpan
attribute.span
- The new value for xSpan
attribute.public double getYSpan()
ySpan
attribute.ySpan
attribute.public void setYSpan(double span)
ySpan
attribute.span
- The new value for the ySpan
attribute.public Object clone()
IlpShelfItemPosition
object.public boolean equals(Object pos)
The result is true
only if the argument is not
null
and is an IlpShelfItemPosition
or an IlvRect
object that represents the same
shelf position as this object.
public int hashCode()
@Deprecated public int getSlotIndex()
getXIndex
instead.IlpShelfItemContainer
.@Deprecated public double getSlotSpan()
getXSpan
instead.IlpShelfItemContainer
.© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.