/** *Retrievesobjectrelationsandpreparesachartdocument. *@throwsStatusExceptionifoneofrelationsnotfound.
*/
@Override protectedvoid before() {
log.println("Setting Diagram type to BarDiagram");
doc = (XChartDocument) tEnv.getObjRelation("CHARTDOC"); if (doc == null) thrownew StatusException(Status.failed
("Relation 'CHARTDOC' not found"));
XDiagram bar = (XDiagram) tEnv.getObjRelation("BAR"); if (bar == null) thrownew StatusException(Status.failed
("Relation 'BAR' not found"));
oldDiagram = doc.getDiagram();
doc.setDiagram(bar);
oObj = UnoRuntime.queryInterface( XPropertySet.class, doc.getDiagram() );
log.println("Set it to 3D"); try {
oObj.setPropertyValue("Dim3D", Boolean.TRUE);
} catch(com.sun.star.lang.WrappedTargetException e) {
log.println("Exception while set property value");
e.printStackTrace(log); thrownew StatusException("Exception while set property value", e);
} catch(com.sun.star.lang.IllegalArgumentException e) {
log.println("Exception while set property value");
e.printStackTrace(log); thrownew StatusException("Exception while set property value", e);
} catch(com.sun.star.beans.PropertyVetoException e) {
log.println("Exception while set property value");
e.printStackTrace(log); thrownew StatusException("Exception while set property value", e);
} catch(com.sun.star.beans.UnknownPropertyException e) {
log.println("Exception while set property value");
e.printStackTrace(log); thrownew StatusException("Exception while set property value", e);
}
}
protected PropertyTester LineTester = new PropertyTester() {
@Override protected Object getNewValue(String propName, Object oldValue) throws java.lang.IllegalArgumentException { int a = 0; int b = 2; if ( ((Integer) oldValue).intValue() == a) return Integer.valueOf(b); else return Integer.valueOf(a);
}
} ;
/** *Testsproperty'NumberOfLines'. *Thispropertytestswhendiagramin2D-modeonly *exceptallotherproperties.Thispropertyiscurrentlysupportedby *twodimensionalverticalbarchartsonly.
*/ publicvoid _NumberOfLines() {
log.println("Set it to 2D"); try {
oObj.setPropertyValue("Dim3D", Boolean.FALSE);
oObj.setPropertyValue("Vertical", Boolean.FALSE);
} catch(com.sun.star.lang.WrappedTargetException e) {
log.println("Exception while set property value");
e.printStackTrace(log); thrownew StatusException("Exception while set property value", e);
} catch(com.sun.star.lang.IllegalArgumentException e) {
log.println("Exception while set property value");
e.printStackTrace(log); thrownew StatusException("Exception while set property value", e);
} catch(com.sun.star.beans.PropertyVetoException e) {
log.println("Exception while set property value");
e.printStackTrace(log); thrownew StatusException("Exception while set property value", e);
} catch(com.sun.star.beans.UnknownPropertyException e) {
log.println("Exception while set property value");
e.printStackTrace(log); thrownew StatusException("Exception while set property value", e);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.