Style Intelligence v12.0

inetsoft.uql.asset
Class AbstractSheet

java.lang.Object
  extended by inetsoft.uql.asset.AbstractSheet
All Implemented Interfaces:
AssetObject, inetsoft.util.XMLSerializable, Serializable, Cloneable
Direct Known Subclasses:
Worksheet

public abstract class AbstractSheet
extends Object
implements AssetObject

AbstractSheet like a spreadsheet, contains several assemblies.

See Also:
Serialized Form

Field Summary
static int ADD_ASSEMBLY
          Add assembly.
static int ANNOTATION_ASSET
          Annotation asset.
static int ANNOTATION_LINE_ASSET
          Annotation line asset.
static int ANNOTATION_RECTANGLE_ASSET
          Annotation rectangle asset.
static int BIND_ASSEMBLY
          Bind assembly.
static int CALENDAR_ASSET
          Calendar asset.
static int CHART_ASSET
          Chart asset.
static int CHECKBOX_ASSET
          Checkbox asset.
static int COMBOBOX_ASSET
          ComboBox asset.
static int CONDITION_ASSET
          Condition asset.
static int CROSSTAB_ASSET
          Crosstab asset.
static int CUBE_ASSET
          Cube asset.
static int CURRENTSELECTION_ASSET
          Group container asset.
static int CYLINDER_ASSET
          Cylinder asset.
static int DATE_RANGE_ASSET
          Date Condition asset.
static int DRILL_BOX_ASSET
          DrillBox asset.
static int EMBEDDEDTABLE_VIEW_ASSET
          Embedded table asset.
static int FONT_FAMILY
          Font family.
static int FORMULA_TABLE_ASSET
          Formula table asset.
static int GAUGE_ASSET
          Gauge asset.
static int GROUPCONTAINER_ASSET
          Group container asset.
protected  HashMap heights
           
static int IMAGE_ASSET
          Image asset.
static int LINE_ASSET
          Line shape asset.
protected static Dimension MIN_SIZE
           
static int NAMED_GROUP_ASSET
          Named group asset.
protected static int NO_MOVEMENT
           
static int OVAL_ASSET
          Oval shape asset.
protected static int PREF_COL
           
static int RADIOBUTTON_ASSET
          RadioButton asset.
static int RECTANGLE_ASSET
          Rectangle shape asset.
static int REMOVE_ASSEMBLY
          Remove assembly.
static int RENAME_ASSEMBLY
          Rename assembly.
static int SELECTION_LIST_ASSET
          Selection list asset.
static int SELECTION_TREE_ASSET
          Selection tree asset.
static int SHEET_DESIGN_MODE
          Sheet design mode.
static int SHEET_RUNTIME_MODE
          Sheet runtime mode.
static int SLIDER_ASSET
          Slider asset.
static int SLIDING_SCALE_ASSET
          Sliding scale asset.
static int SPINNER_ASSET
          Spinner asset.
static int SUBMIT_ASSET
          Submit asset.
static int TAB_ASSET
          Tab asset.
static int TABLE_ASSET
          Table asset.
static int TABLE_VIEW_ASSET
          Table view asset.
static int TEXT_ASSET
          Text asset.
static int TEXTINPUT_ASSET
          TextInput asset.
static int THERMOMETER_ASSET
          Thermometer asset.
static int TIME_SLIDER_ASSET
          Time slider asset.
static int UPLOAD_ASSET
          Upload asset.
static int USER_FORMAT
          User format.
static int VARIABLE_ASSET
          Variable asset.
static int VIEWSHEET_ASSET
          Viewsheet asset.
static int VIEWSHEET_SNAPSHOT_ASSET
          Viewsheet snapshot asset.
protected  HashMap widths
           
protected static int X_MOVEMENT
           
protected static int Y_MOVEMENT
           
 
Constructor Summary
AbstractSheet()
          Create a sheet object.
 
Method Summary
 void addActionListener(ActionListener listener)
          Add an action listener observes asset changes.
abstract  boolean addOuterDependency(AssetEntry entry)
          Add an outer dependency.
 int addr()
          Get the original hash code.
abstract  void checkDependencies()
          Check if the dependency is valid.
abstract  void checkValidity()
          Check if the sheet is valid.
 Object clone()
          Clone the object.
abstract  boolean containsAssembly(String name)
          Check if contains an assembly.
 void fireEvent(int type, String cmd)
          Fire event.
protected  Rectangle getActualBounds(Assembly assembly)
          Get the pixel bounds of an embed viewsheet.
abstract  Assembly[] getAssemblies()
          Get all the assemblies.
abstract  Assembly getAssembly(AssemblyEntry entry)
          Get an assembly by its entry.
abstract  Assembly getAssembly(String name)
          Get an assembly by its name.
 int getColWidth(int col)
          Get the column width of a column.
 int getColX(int col)
          Get the start point of a column.
 long getCreated()
          Get created time.
 String getCreatedBy()
          Get the created person.
abstract  AssemblyRef[] getDependeds(AssemblyEntry entry)
          Get the assemblies depended on of an assembly in a sheet.
abstract  AssemblyRef[] getDependeds(AssemblyEntry entry, boolean view, boolean out)
          Get the assemblies depended on of an assembly in a viewsheet.
 String getDescription()
          Get the description of the worksheet.
protected abstract  int getGap()
          Get the gap between two assemblies.
 long getLastModified()
          Get last modified time.
 long getLastModified(boolean recursive)
          Get last modified.
 String getLastModifiedBy()
          Get last modified person.
 Dimension getLastSize()
          Get last size of the sheet.
protected  Rectangle getLayoutBounds(Assembly assembly)
          Get the layout bounds of an assembly.
 XQueryRepository getLocalQueryRepository()
          Get the local query repository.
abstract  AssetEntry[] getOuterDependencies()
          Get the outer dependencies.
abstract  AssetEntry[] getOuterDependents()
          Get the outer dependents.
 int getRowHeight(int row)
          Get the row height of a row.
 int getRowY(int row)
          Get the start point of a row.
abstract  Dimension getSize()
          Get the size of this sheet.
abstract  int getType()
          Get the type of the sheet.
 boolean isFireEvent()
          Check if fire event when fireEvent is called.
protected  boolean isLayoutVisible(Assembly assembly)
          Check if is visible when layout.
 Assembly[] layout()
          Layout the sheet.
 Assembly[] layout(boolean vonly)
          Layout the sheet.
 Assembly[] layout(boolean vonly, ArrayList arr)
          Layout the sheet.
protected  int moveY(Assembly a, Assembly b, boolean vonly)
          Move one assembly in y dimension.
protected  void parseWHXML(Element elem, Map map)
          Parse widths/heights xml.
 void removeActionListener(ActionListener listener)
          Remove an action listener registered.
 void removeActionListeners()
          Remove all the action listeners.
abstract  void removeOuterDependencies()
          Remove all the outer dependencies.
abstract  boolean removeOuterDependency(AssetEntry entry)
          Remove an outer dependency.
abstract  void renameOuterDependent(AssetEntry oentry, AssetEntry nentry)
          Rename an outer dependent.
abstract  void reset()
          Reset the sheet.
 void resetSize()
          Reset the size of the sheet.
 boolean setColWidth(int col, int width)
          Set the column width of a column.
 void setCreated(long created)
          Set created time.
 void setCreatedBy(String createdBy)
          Set the created person
 void setFireEvent(boolean event)
          Set whether fire event when fireEvent is called.
 void setLastModified(long modified)
          Set last modified time.
 void setLastModifiedBy(String modifiedBy)
          Set last modified person.
 void setLastSize(Dimension lsize)
          Set last size to the sheet.
 void setLocalQueryRepository(XQueryRepository rep)
          Set the local query repository.
 boolean setRowHeight(int row, int height)
          Set the row height of a row.
protected  void shrink()
          Shrink the sheet width/height settings if possible.
abstract  boolean update(AssetRepository rep, AssetEntry entry, Principal user)
          Update this sheet.
 void writeData(JarOutputStream out)
          Write out data content in each assembly.
protected  void writeWHXML(String name, PrintWriter writer, Map map)
          Write widths/heights xml.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface inetsoft.util.XMLSerializable
parseXML, writeXML
 

Field Detail

SHEET_DESIGN_MODE

public static final int SHEET_DESIGN_MODE
Sheet design mode.

See Also:
Constant Field Values

SHEET_RUNTIME_MODE

public static final int SHEET_RUNTIME_MODE
Sheet runtime mode.

See Also:
Constant Field Values

CONDITION_ASSET

public static final int CONDITION_ASSET
Condition asset.

See Also:
Constant Field Values

NAMED_GROUP_ASSET

public static final int NAMED_GROUP_ASSET
Named group asset.

See Also:
Constant Field Values

VARIABLE_ASSET

public static final int VARIABLE_ASSET
Variable asset.

See Also:
Constant Field Values

TABLE_ASSET

public static final int TABLE_ASSET
Table asset.

See Also:
Constant Field Values

DATE_RANGE_ASSET

public static final int DATE_RANGE_ASSET
Date Condition asset.

See Also:
Constant Field Values

TABLE_VIEW_ASSET

public static final int TABLE_VIEW_ASSET
Table view asset.

See Also:
Constant Field Values

CHART_ASSET

public static final int CHART_ASSET
Chart asset.

See Also:
Constant Field Values

CROSSTAB_ASSET

public static final int CROSSTAB_ASSET
Crosstab asset.

See Also:
Constant Field Values

FORMULA_TABLE_ASSET

public static final int FORMULA_TABLE_ASSET
Formula table asset.

See Also:
Constant Field Values

CUBE_ASSET

public static final int CUBE_ASSET
Cube asset.

See Also:
Constant Field Values

SLIDER_ASSET

public static final int SLIDER_ASSET
Slider asset.

See Also:
Constant Field Values

SPINNER_ASSET

public static final int SPINNER_ASSET
Spinner asset.

See Also:
Constant Field Values

CHECKBOX_ASSET

public static final int CHECKBOX_ASSET
Checkbox asset.

See Also:
Constant Field Values

RADIOBUTTON_ASSET

public static final int RADIOBUTTON_ASSET
RadioButton asset.

See Also:
Constant Field Values

COMBOBOX_ASSET

public static final int COMBOBOX_ASSET
ComboBox asset.

See Also:
Constant Field Values

TEXT_ASSET

public static final int TEXT_ASSET
Text asset.

See Also:
Constant Field Values

IMAGE_ASSET

public static final int IMAGE_ASSET
Image asset.

See Also:
Constant Field Values

GAUGE_ASSET

public static final int GAUGE_ASSET
Gauge asset.

See Also:
Constant Field Values

THERMOMETER_ASSET

public static final int THERMOMETER_ASSET
Thermometer asset.

See Also:
Constant Field Values

SLIDING_SCALE_ASSET

public static final int SLIDING_SCALE_ASSET
Sliding scale asset.

See Also:
Constant Field Values

CYLINDER_ASSET

public static final int CYLINDER_ASSET
Cylinder asset.

See Also:
Constant Field Values

SELECTION_LIST_ASSET

public static final int SELECTION_LIST_ASSET
Selection list asset.

See Also:
Constant Field Values

SELECTION_TREE_ASSET

public static final int SELECTION_TREE_ASSET
Selection tree asset.

See Also:
Constant Field Values

TIME_SLIDER_ASSET

public static final int TIME_SLIDER_ASSET
Time slider asset.

See Also:
Constant Field Values

CALENDAR_ASSET

public static final int CALENDAR_ASSET
Calendar asset.

See Also:
Constant Field Values

DRILL_BOX_ASSET

public static final int DRILL_BOX_ASSET
DrillBox asset.

See Also:
Constant Field Values

TAB_ASSET

public static final int TAB_ASSET
Tab asset.

See Also:
Constant Field Values

EMBEDDEDTABLE_VIEW_ASSET

public static final int EMBEDDEDTABLE_VIEW_ASSET
Embedded table asset.

See Also:
Constant Field Values

GROUPCONTAINER_ASSET

public static final int GROUPCONTAINER_ASSET
Group container asset.

See Also:
Constant Field Values

LINE_ASSET

public static final int LINE_ASSET
Line shape asset.

See Also:
Constant Field Values

RECTANGLE_ASSET

public static final int RECTANGLE_ASSET
Rectangle shape asset.

See Also:
Constant Field Values

OVAL_ASSET

public static final int OVAL_ASSET
Oval shape asset.

See Also:
Constant Field Values

CURRENTSELECTION_ASSET

public static final int CURRENTSELECTION_ASSET
Group container asset.

See Also:
Constant Field Values

TEXTINPUT_ASSET

public static final int TEXTINPUT_ASSET
TextInput asset.

See Also:
Constant Field Values

SUBMIT_ASSET

public static final int SUBMIT_ASSET
Submit asset.

See Also:
Constant Field Values

UPLOAD_ASSET

public static final int UPLOAD_ASSET
Upload asset.

See Also:
Constant Field Values

ANNOTATION_ASSET

public static final int ANNOTATION_ASSET
Annotation asset.

See Also:
Constant Field Values

ANNOTATION_LINE_ASSET

public static final int ANNOTATION_LINE_ASSET
Annotation line asset.

See Also:
Constant Field Values

ANNOTATION_RECTANGLE_ASSET

public static final int ANNOTATION_RECTANGLE_ASSET
Annotation rectangle asset.

See Also:
Constant Field Values

VIEWSHEET_ASSET

public static final int VIEWSHEET_ASSET
Viewsheet asset.

See Also:
Constant Field Values

VIEWSHEET_SNAPSHOT_ASSET

public static final int VIEWSHEET_SNAPSHOT_ASSET
Viewsheet snapshot asset.

See Also:
Constant Field Values

FONT_FAMILY

public static final int FONT_FAMILY
Font family.

See Also:
Constant Field Values

USER_FORMAT

public static final int USER_FORMAT
User format.

See Also:
Constant Field Values

ADD_ASSEMBLY

public static final int ADD_ASSEMBLY
Add assembly.

See Also:
Constant Field Values

REMOVE_ASSEMBLY

public static final int REMOVE_ASSEMBLY
Remove assembly.

See Also:
Constant Field Values

RENAME_ASSEMBLY

public static final int RENAME_ASSEMBLY
Rename assembly.

See Also:
Constant Field Values

BIND_ASSEMBLY

public static final int BIND_ASSEMBLY
Bind assembly.

See Also:
Constant Field Values

MIN_SIZE

protected static final Dimension MIN_SIZE

NO_MOVEMENT

protected static final int NO_MOVEMENT
See Also:
Constant Field Values

X_MOVEMENT

protected static final int X_MOVEMENT
See Also:
Constant Field Values

Y_MOVEMENT

protected static final int Y_MOVEMENT
See Also:
Constant Field Values

PREF_COL

protected static final int PREF_COL
See Also:
Constant Field Values

widths

protected HashMap widths

heights

protected HashMap heights
Constructor Detail

AbstractSheet

public AbstractSheet()
Create a sheet object.

Method Detail

getSize

public abstract Dimension getSize()
Get the size of this sheet.

Returns:
the size of this sheet.

containsAssembly

public abstract boolean containsAssembly(String name)
Check if contains an assembly.

Parameters:
name - the specified assembly name.
Returns:
true if yes, false otherwise.

getAssembly

public abstract Assembly getAssembly(AssemblyEntry entry)
Get an assembly by its entry.

Parameters:
entry - the specified assembly entry.
Returns:
the assembly, null if not found.

getAssembly

public abstract Assembly getAssembly(String name)
Get an assembly by its name.

Parameters:
name - the specified assembly name.
Returns:
the assembly, null if not found.

getAssemblies

public abstract Assembly[] getAssemblies()
Get all the assemblies.

Returns:
all the assemblies.

getGap

protected abstract int getGap()
Get the gap between two assemblies.

Returns:
the gap between two assemblies.

getOuterDependents

public abstract AssetEntry[] getOuterDependents()
Get the outer dependents.

Returns:
the outer dependents.

renameOuterDependent

public abstract void renameOuterDependent(AssetEntry oentry,
                                          AssetEntry nentry)
Rename an outer dependent.

Parameters:
oentry - the specified old entry.
nentry - the specified new entry.

getOuterDependencies

public abstract AssetEntry[] getOuterDependencies()
Get the outer dependencies.

Returns:
the outer dependencies.

addOuterDependency

public abstract boolean addOuterDependency(AssetEntry entry)
Add an outer dependency.

Parameters:
entry - the specified entry.
Returns:
true if successful, false otherwise.

removeOuterDependency

public abstract boolean removeOuterDependency(AssetEntry entry)
Remove an outer dependency.

Parameters:
entry - the specified entry.
Returns:
true if successful, false otherwise.

removeOuterDependencies

public abstract void removeOuterDependencies()
Remove all the outer dependencies.


update

public abstract boolean update(AssetRepository rep,
                               AssetEntry entry,
                               Principal user)
Update this sheet.

Parameters:
rep - the specified asset repository.
entry - the specified entry stored in.
user - the specified principal.

checkValidity

public abstract void checkValidity()
                            throws Exception
Check if the sheet is valid.

Throws:
Exception

checkDependencies

public abstract void checkDependencies()
                                throws InvalidDependencyException
Check if the dependency is valid.

Throws:
InvalidDependencyException

getType

public abstract int getType()
Get the type of the sheet.

Returns:
the type of the sheet.

reset

public abstract void reset()
Reset the sheet.


getDependeds

public abstract AssemblyRef[] getDependeds(AssemblyEntry entry)
Get the assemblies depended on of an assembly in a sheet.

Parameters:
entry - the specified assembly entry.

getDependeds

public abstract AssemblyRef[] getDependeds(AssemblyEntry entry,
                                           boolean view,
                                           boolean out)
Get the assemblies depended on of an assembly in a viewsheet.

Parameters:
entry - the specified assembly entry.
view - true to include view, false otherwise.
out - out to include out, false otherwise.

setLocalQueryRepository

public void setLocalQueryRepository(XQueryRepository rep)
Set the local query repository.

Parameters:
rep - the specified local query repository.

getLocalQueryRepository

public XQueryRepository getLocalQueryRepository()
Get the local query repository.

Returns:
the local query repository.

setLastSize

public void setLastSize(Dimension lsize)
Set last size to the sheet.

Parameters:
lsize - the specified last size.

getLastSize

public Dimension getLastSize()
Get last size of the sheet.

Returns:
last size of the sheet.

getRowHeight

public int getRowHeight(int row)
Get the row height of a row.

Parameters:
row - the specified row.
Returns:
the row height of the row.

getRowY

public int getRowY(int row)
Get the start point of a row.

Parameters:
row - the specified row.
Returns:
the start point of a row.

setRowHeight

public boolean setRowHeight(int row,
                            int height)
Set the row height of a row.

Parameters:
row - the specified row.
height - the specified height.
Returns:
true if successful, false otherwise.

getColWidth

public int getColWidth(int col)
Get the column width of a column.

Parameters:
col - the specified column.
Returns:
the column width of the column.

setColWidth

public boolean setColWidth(int col,
                           int width)
Set the column width of a column.

Parameters:
col - the specified column.
width - the specified width.
Returns:
true if successful, false otherwise.

resetSize

public void resetSize()
Reset the size of the sheet.


getColX

public int getColX(int col)
Get the start point of a column.

Parameters:
col - the specified column.
Returns:
the start point of a column.

layout

public Assembly[] layout(boolean vonly,
                         ArrayList arr)
Layout the sheet. Any overlapping assemblies are moved.

Parameters:
vonly - true if vertical movement only, false both directions are ok.
arr - the assemblies need be layout.
Returns:
the assemblies relocated.

shrink

protected void shrink()
Shrink the sheet width/height settings if possible.


getActualBounds

protected Rectangle getActualBounds(Assembly assembly)
Get the pixel bounds of an embed viewsheet. Only calculate the pixel bounds for embed viewsheet, and it will be override by Viewsheet.java.

Parameters:
assembly - the specified assembly.
Returns:
the layout bounds of the assembly.

getLayoutBounds

protected Rectangle getLayoutBounds(Assembly assembly)
Get the layout bounds of an assembly.

Parameters:
assembly - the specified assembly.
Returns:
the layout bounds of the assembly.

isLayoutVisible

protected boolean isLayoutVisible(Assembly assembly)
Check if is visible when layout.

Parameters:
assembly - the specified assembly.
Returns:
true if visible when layout, false otherwise.

layout

public Assembly[] layout()
Layout the sheet. Any overlapping assemblies are moved.

Returns:
the names of the assemblies relocated.

layout

public Assembly[] layout(boolean vonly)
Layout the sheet. Any overlapping assemblies are moved.

Parameters:
vonly - true if vertical movement only, false both directions are ok.
Returns:
the names of the assemblies relocated.

moveY

protected int moveY(Assembly a,
                    Assembly b,
                    boolean vonly)
Move one assembly in y dimension.

Parameters:
a - the specified assembly a.
b - the specified assembly b to move.
vonly - true if vertical movement only, false both directions are ok.
Returns:
the move result.

setLastModified

public void setLastModified(long modified)
Set last modified time.

Parameters:
modified - the specified last modified time.

getLastModified

public long getLastModified()
Get last modified time.

Returns:
last modified time.

getLastModified

public long getLastModified(boolean recursive)
Get last modified.

Returns:
last modified time.

setCreated

public void setCreated(long created)
Set created time.

Parameters:
created - the specified created time.

getCreated

public long getCreated()
Get created time.

Returns:
created time.

setLastModifiedBy

public void setLastModifiedBy(String modifiedBy)
Set last modified person.

Parameters:
modified - the specified last modified person.

getLastModifiedBy

public String getLastModifiedBy()
Get last modified person.

Returns:
last modified person.

setCreatedBy

public void setCreatedBy(String createdBy)
Set the created person

Parameters:
createdBy - the created person.

getCreatedBy

public String getCreatedBy()
Get the created person.

Returns:
the created person.

addActionListener

public void addActionListener(ActionListener listener)
Add an action listener observes asset changes.


removeActionListener

public void removeActionListener(ActionListener listener)
Remove an action listener registered.


removeActionListeners

public void removeActionListeners()
Remove all the action listeners.


isFireEvent

public boolean isFireEvent()
Check if fire event when fireEvent is called.

Returns:
false if not to fire event to listeners.

setFireEvent

public void setFireEvent(boolean event)
Set whether fire event when fireEvent is called.

Parameters:
event, - false if not to fire event to listeners.

fireEvent

public void fireEvent(int type,
                      String cmd)
Fire event.

Parameters:
type - the specified sheet type.
cmd - the specified command.

writeData

public void writeData(JarOutputStream out)
Write out data content in each assembly.


writeWHXML

protected void writeWHXML(String name,
                          PrintWriter writer,
                          Map map)
Write widths/heights xml.

Parameters:
name - the specified name.
writer - the specified writer.
map - the specified map.

parseWHXML

protected void parseWHXML(Element elem,
                          Map map)
Parse widths/heights xml.

Parameters:
elem - the specified xml element.
map - the specified map.

getDescription

public String getDescription()
Get the description of the worksheet.

Returns:
the description of the worksheet.

clone

public Object clone()
Clone the object.

Specified by:
clone in interface AssetObject
Overrides:
clone in class Object
Returns:
the cloned object.

addr

public int addr()
Get the original hash code.

Returns:
the original hash code.

Copyright © 1996-2014 InetSoft Technology Corp. All Rights Reserved.