📄 fsshapestyle.java
字号:
{
setLineStyle(lineStyleIndex);
setFillStyle(fillStyleIndex);
setAltFillStyle(altFillStyleIndex);
setMoveX(relativeX);
setMoveY(relativeY);
}
/** Constructs an FSShapeStyle object, selecting the line and fill styles, new line and new fill styles.
@param lineStyleIndex selects the line style at lineStyleIndex in the line styles array of the parent FSShape object.
@param fillStyleIndex selects the fill style at fillStyleIndex in the fill styles array of the parent FSShape object.
@param altFillStyleIndex selects the alternate fill style at altFillStyleIndex in the fill styles array of the parent FSShape object.
@param lineStylesArray an array of FSLineStyle objects.
@param fillStylesArray an array of fill style objects.
*/
public FSShapeStyle(int lineStyleIndex, int fillStyleIndex, int altFillStyleIndex, ArrayList lineStylesArray, ArrayList fillStylesArray)
{
setLineStyle(lineStyleIndex);
setFillStyle(fillStyleIndex);
setAltFillStyle(altFillStyleIndex);
setLineStyles(lineStylesArray);
setFillStyles(fillStylesArray);
}
/** Constructs an FSShapeStyle object, selecting the line and fill styles, drawing point, new line and new fill styles.
@param lineStyleIndex selects the line style at lineStyleIndex in the line styles array of the parent FSShape object.
@param fillStyleIndex selects the fill style at fillStyleIndex in the fill styles array of the parent FSShape object.
@param altFillStyleIndex selects the alternate fill style at altFillStyleIndex in the fill styles array of the parent FSShape object.
@param relativeX move the current point by relativeX in the x direction.
@param relativeY move the current point by relativeY in the y direction.
@param lineStylesArray an array of FSLineStyle objects.
@param fillStylesArray an array of fill style objects.
*/
public FSShapeStyle(int lineStyleIndex, int fillStyleIndex, int altFillStyleIndex, int relativeX, int relativeY, ArrayList lineStylesArray, ArrayList fillStylesArray)
{
setLineStyle(lineStyleIndex);
setFillStyle(fillStyleIndex);
setAltFillStyle(altFillStyleIndex);
setMoveX(relativeX);
setMoveY(relativeY);
setLineStyles(lineStylesArray);
setFillStyles(fillStylesArray);
}
/**
* Constructs an FSShapeStyle object by copying values from an existing
* object.
*
* @param obj an FSShapeStyle object.
*/
public FSShapeStyle(FSShapeStyle obj)
{
moveX = obj.moveX;
moveY = obj.moveY;
fillStyle = obj.fillStyle;
altFillStyle = obj.altFillStyle;
lineStyle = obj.lineStyle;
if (obj.fillStyles != null)
{
fillStyles = new ArrayList();
for (Iterator i = obj.fillStyles.iterator(); i.hasNext();)
fillStyles.add(((FSFillStyle)i.next()).clone());
}
if (obj.lineStyles != null)
{
lineStyles = new ArrayList();
for (Iterator i = obj.lineStyles.iterator(); i.hasNext();)
lineStyles.add(((FSLineStyle)i.next()).clone());
}
}
/** Add a FSSolidLine object to the array of line styles.
@param aLineStyle and FSSolidLine object.
*/
public void add(FSLineStyle aLineStyle)
{
lineStyles.add(aLineStyle);
}
/** Add the fill style object to the array of fill styles.
@param aFillStyle and FSFillStyle object.
*/
public void add(FSFillStyle aFillStyle)
{
fillStyles.add(aFillStyle);
}
/** Gets the x-coordinate of any relative move specified.
@return the x-coordinate of the relative move.
*/
public int getMoveX()
{
return moveX;
}
/** Gets the y-coordinate of any relative move specified. If the attribute is set to Transform.VALUE_NOT_SET then the value is not affected.
@return the y-coordinate of the relative move.
*/
public int getMoveY()
{
return moveY;
}
/** Gets the index of the line style that will be applied to any line drawn. Returns the value Transform.VALUE_NOT_SET if no line style is defined.
@return the index of the selected line style.
*/
public int getLineStyle() { return lineStyle; }
/** Gets the index of the fill style that will be applied to any area filled. Returns the value Transform.VALUE_NOT_SET if no fill style is defined.
@return the index of the selected fill style.
*/
public int getFillStyle() { return fillStyle; }
/** Gets the index of the fill style that will be applied to any overlapping area filled. Returns the value Transform.VALUE_NOT_SET if no alternate fill style is defined.
@return the index of the selected alternate style.
*/
public int getAltFillStyle() { return altFillStyle; }
/** Gets the array of new line styles.
@return the array of FSLineStyle objects.
*/
public ArrayList getLineStyles() { return lineStyles; }
/** Gets the array of new fill styles.
@return the array of fill style objects.
*/
public ArrayList getFillStyles() { return fillStyles; }
/** Sets the x-coordinate of any relative move. May be set to Transform.VALUE_NOT_SET if the attribute should not be encoded.
@param aNumber move the current point by aNumber in the x direction.
*/
public void setMoveX(int aNumber)
{
moveX = aNumber;
}
/** Sets the y-coordinate of any relative move. May be set to Transform.VALUE_NOT_SET if the attribute should not be encoded.
@param aNumber move the current point by aNumber in the y direction.
*/
public void setMoveY(int aNumber)
{
moveY = aNumber;
}
/** Sets the drawing point.
@param x the x-coordinate of the drawing point.
@param y the y-coordinate of the drawing point.
*/
public void setMove(int x, int y)
{
moveX = x;
moveY = y;
}
/** Sets the index of the fill style that will be applied to any area filled. May be set to zero if no style is selected or Transform.VALUE_NOT_SET if the attribute should not be encoded.
@param anIndex selects the fill style at anIndex in the fill styles array of the parent FSShape object.
*/
public void setFillStyle(int anIndex)
{
fillStyle = anIndex;
}
/** Sets the index of the fill style that will be applied to any overlapping area filled. May be set to zero if no style is selected or Transform.VALUE_NOT_SET if the attribute should not be encoded.
@param anIndex selects the alternate fill style at anIndex in the fill styles array of the parent FSShape object.
*/
public void setAltFillStyle(int anIndex)
{
altFillStyle = anIndex;
}
/** Sets the index of the line style that will be applied to any line drawn. May be set to zero if no style is selected or Transform.VALUE_NOT_SET if the attribute should not be encoded.
@param anIndex selects the line style at anIndex in the line styles array of the parent FSShape object.
*/
public void setLineStyle(int anIndex)
{
lineStyle = anIndex;
}
/** Sets the array of new line styles. May be set to null if no styles are being defined.
@param anArray an array of FSLineStyle objects.
*/
public void setLineStyles(ArrayList anArray)
{
lineStyles = anArray;
}
/** Sets the array of new fill styles. May be set to null if no styles are being defined.
@param anArray an array of fill style objects.
*/
public void setFillStyles(ArrayList anArray)
{
fillStyles = anArray;
}
public Object clone()
{
FSShapeStyle anObject = (FSShapeStyle)super.clone();
if (fillStyles != null)
{
anObject.fillStyles = new ArrayList();
for (Iterator i = fillStyles.iterator(); i.hasNext();)
anObject.fillStyles.add(((FSFillStyle)i.next()).clone());
}
if (lineStyles != null)
{
anObject.lineStyles = new ArrayList();
for (Iterator i = lineStyles.iterator(); i.hasNext();)
anObject.lineStyles.add(((FSLineStyle)i.next()).clone());
}
return anObject;
}
/**
* Returns true if anObject is equal to this one. Objects are considered
* equal if they would generate identical binary data when they are encoded
* to a Flash file.
*
* @return true if this object would be identical to anObject when encoded.
*/
public boolean equals(Object anObject)
{
boolean result = false;
if (super.equals(anObject))
{
FSShapeStyle typedObject = (FSShapeStyle)anObject;
result = moveX == typedObject.moveX;
result = result && moveY == typedObject.moveY;
result = result && fillStyle == typedObject.fillStyle;
result = result && altFillStyle == typedObject.altFillStyle;
result = result && lineStyle == typedObject.lineStyle;
if (fillStyles != null)
result = result && fillStyles.equals(typedObject.fillStyles);
else
result = result && fillStyles == typedObject.fillStyles;
if (lineStyles != null)
result = result && lineStyles.equals(typedObject.lineStyles);
else
result = result && lineStyles == typedObject.lineStyles;
}
return result;
}
public void appendDescription(StringBuffer buffer, int depth)
{
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -