-/*******************************************************************************\r
- * Copyright (c) 2007, 2011 Association for Decentralized Information Management in\r
- * Industry THTH ry.\r
- * All rights reserved. This program and the accompanying materials\r
- * are made available under the terms of the Eclipse Public License v1.0\r
- * which accompanies this distribution, and is available at\r
- * http://www.eclipse.org/legal/epl-v10.html\r
- *\r
- * Contributors:\r
- * VTT Technical Research Centre of Finland - initial API and implementation\r
- *******************************************************************************/\r
-package org.simantics.charts.preference;\r
-\r
-import org.simantics.charts.ontology.ChartResource;\r
-import org.simantics.databoard.annotations.Optional;\r
-import org.simantics.databoard.annotations.Range;\r
-import org.simantics.databoard.annotations.Unit;\r
-import org.simantics.databoard.util.Bean;\r
-\r
-public class ChartTimeWindowTemplate extends Bean {\r
-\r
- public static final ChartTimeWindowTemplate WholeHistory, Last60Seconds, Last10Minutes;\r
- public static final String[][] radioGroup;\r
- \r
- public String id;\r
- public String Label;\r
- public String uri;\r
- public @Unit("s") @Optional Double HasTimeWindowStart; \r
- public @Unit("s") @Optional Double TimeWindowLength;\r
- public @Range("[0..100]") @Optional Double TimeWindowIncrement;\r
- \r
- public static ChartTimeWindowTemplate getTemplate(String id)\r
- {\r
- if (id.equals(WholeHistory.id)) return WholeHistory;\r
- if (id.equals(Last60Seconds.id)) return Last60Seconds;\r
- if (id.equals(Last10Minutes.id)) return Last10Minutes;\r
- return null;\r
- }\r
- \r
- static {\r
- WholeHistory = new ChartTimeWindowTemplate();\r
- WholeHistory.id = "WholeHistory";\r
- WholeHistory.Label = "Whole History";\r
- WholeHistory.TimeWindowIncrement = 50.0;\r
- WholeHistory.uri = ChartResource.URIs.WholeHistoryChartTemplate;\r
-\r
- Last60Seconds = new ChartTimeWindowTemplate();\r
- Last60Seconds.id = "Last60Seconds";\r
- Last60Seconds.Label = "Last 60 Seconds";\r
- Last60Seconds.TimeWindowIncrement = 50.0;\r
- Last60Seconds.TimeWindowLength = 60.0;\r
- Last60Seconds.uri = ChartResource.URIs.Last60SecondsChartTemplate;\r
-\r
- Last10Minutes = new ChartTimeWindowTemplate();\r
- Last10Minutes.id = "Last10Minutes";\r
- Last10Minutes.Label = "Last 10 Minutes";\r
- Last10Minutes.TimeWindowIncrement = 50.0;\r
- Last10Minutes.TimeWindowLength = 600.0;\r
- Last10Minutes.uri = ChartResource.URIs.Last10MinutesChartTemplate;\r
- \r
- radioGroup = \r
- new String[][] { \r
- { WholeHistory.Label, WholeHistory.id }, \r
- { Last60Seconds.Label, Last60Seconds.id }, \r
- { Last10Minutes.Label, Last10Minutes.id } \r
- };\r
- }\r
- \r
- public static void main(String[] args) throws Exception {\r
- \r
- System.out.println( WholeHistory );\r
- System.out.println( Last60Seconds );\r
- System.out.println( Last10Minutes );\r
- \r
- }\r
- \r
-}\r
+/*******************************************************************************
+ * Copyright (c) 2007, 2011 Association for Decentralized Information Management in
+ * Industry THTH ry.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * VTT Technical Research Centre of Finland - initial API and implementation
+ *******************************************************************************/
+package org.simantics.charts.preference;
+
+import org.simantics.charts.ontology.ChartResource;
+import org.simantics.databoard.annotations.Optional;
+import org.simantics.databoard.annotations.Range;
+import org.simantics.databoard.annotations.Unit;
+import org.simantics.databoard.util.Bean;
+
+public class ChartTimeWindowTemplate extends Bean {
+
+ public static final ChartTimeWindowTemplate WholeHistory, Last60Seconds, Last10Minutes;
+ public static final String[][] radioGroup;
+
+ public String id;
+ public String Label;
+ public String uri;
+ public @Unit("s") @Optional Double HasTimeWindowStart;
+ public @Unit("s") @Optional Double TimeWindowLength;
+ public @Range("[0..100]") @Optional Double TimeWindowIncrement;
+
+ public static ChartTimeWindowTemplate getTemplate(String id)
+ {
+ if (id.equals(WholeHistory.id)) return WholeHistory;
+ if (id.equals(Last60Seconds.id)) return Last60Seconds;
+ if (id.equals(Last10Minutes.id)) return Last10Minutes;
+ return null;
+ }
+
+ static {
+ WholeHistory = new ChartTimeWindowTemplate();
+ WholeHistory.id = "WholeHistory";
+ WholeHistory.Label = "Whole History";
+ WholeHistory.TimeWindowIncrement = 50.0;
+ WholeHistory.uri = ChartResource.URIs.WholeHistoryChartTemplate;
+
+ Last60Seconds = new ChartTimeWindowTemplate();
+ Last60Seconds.id = "Last60Seconds";
+ Last60Seconds.Label = "Last 60 Seconds";
+ Last60Seconds.TimeWindowIncrement = 50.0;
+ Last60Seconds.TimeWindowLength = 60.0;
+ Last60Seconds.uri = ChartResource.URIs.Last60SecondsChartTemplate;
+
+ Last10Minutes = new ChartTimeWindowTemplate();
+ Last10Minutes.id = "Last10Minutes";
+ Last10Minutes.Label = "Last 10 Minutes";
+ Last10Minutes.TimeWindowIncrement = 50.0;
+ Last10Minutes.TimeWindowLength = 600.0;
+ Last10Minutes.uri = ChartResource.URIs.Last10MinutesChartTemplate;
+
+ radioGroup =
+ new String[][] {
+ { WholeHistory.Label, WholeHistory.id },
+ { Last60Seconds.Label, Last60Seconds.id },
+ { Last10Minutes.Label, Last10Minutes.id }
+ };
+ }
+
+ public static void main(String[] args) throws Exception {
+
+ System.out.println( WholeHistory );
+ System.out.println( Last60Seconds );
+ System.out.println( Last10Minutes );
+
+ }
+
+}