From 2500e40c21aedc8ecca0b5c218fa4c4d72d03aae Mon Sep 17 00:00:00 2001 From: Michael Hoffer Date: Tue, 30 May 2017 15:01:16 +0200 Subject: [PATCH] New skipEmptyViewCallInSetValue param option added for type-representations. Enabling this property allows for smooth animations produced by successive method calls. Should fix issue #71 : https://github.com/VRL-Studio/VRL/issues/71 --- .../reflection/TypeRepresentationBase.java | 302 +++++++++--------- .../vrl/resources/changelog/changelog.txt | 21 ++ VRL/src/eu/mihosoft/vrl/system/Constants.java | 262 +++++++-------- 3 files changed, 299 insertions(+), 286 deletions(-) diff --git a/VRL/src/eu/mihosoft/vrl/reflection/TypeRepresentationBase.java b/VRL/src/eu/mihosoft/vrl/reflection/TypeRepresentationBase.java index 8fbf309e..a1cdb434 100644 --- a/VRL/src/eu/mihosoft/vrl/reflection/TypeRepresentationBase.java +++ b/VRL/src/eu/mihosoft/vrl/reflection/TypeRepresentationBase.java @@ -84,12 +84,10 @@ *

* Base class for type representations.

*

- * Note: inherit this class to create a completely new type - * representation. Additionally, it is possible to customize an already existing - * type representation. For textfield based type representations, - * {@link eu.mihosoft.vrl.types.VTextFieldBasedTypeRepresentation} is a good - * starting point. Image based type representations should inherit - * {@link eu.mihosoft.vrl.types.BufferedImageType}.

+ * Note: inherit this class to create a completely new type representation. Additionally, it is possible to + * customize an already existing type representation. For textfield based type representations, + * {@link eu.mihosoft.vrl.types.VTextFieldBasedTypeRepresentation} is a good starting point. Image based type + * representations should inherit {@link eu.mihosoft.vrl.types.BufferedImageType}.

*

* Example (Groovy code):

*

@@ -171,10 +169,10 @@ *

* *

- * Supported value options:

+ * Supported value options:
* * @author Michael Hoffer <info@michaelhoffer.de> * @see BufferedImageType @@ -215,6 +213,7 @@ public abstract class TypeRepresentationBase extends VComponent private boolean noGUI = false; protected boolean serialization = true; private boolean warningIfNoCodeGeneration = true; + private boolean skipEmptyViewCallInSetValue = false; private ParamInfo paramInfo; /** * list of action listeners @@ -298,9 +297,8 @@ protected void fireAction(ActionEvent event) { } /** - * Switches to debug mode. In debug mode the bounding box (rectangular - * border) will be drawn to indicate the dimensions of this type - * representation. + * Switches to debug mode. In debug mode the bounding box (rectangular border) will be drawn to indicate the + * dimensions of this type representation. */ public void setDebugMode() { setBackground(Color.RED); @@ -317,9 +315,8 @@ public Insets getInsets() { // // want the object to be invisible // } /** - * Defines the return value as up to date. A return value usually is defined - * as up tp date if after the last assignment from method call none of the - * input values (their representations) changed. + * Defines the return value as up to date. A return value usually is defined as up tp date if after the last + * assignment from method call none of the input values (their representations) changed. */ public void setReturnTypeUpToDate() { if (parentMethod != null) { @@ -330,9 +327,8 @@ public void setReturnTypeUpToDate() { } /** - * Defines the data of this representation as outdated. If the data of a - * type representation is outdated a method call will be triggered if data - * from the corresponding return type representation is requested. + * Defines the data of this representation as outdated. If the data of a type representation is outdated a method + * call will be triggered if data from the corresponding return type representation is requested. */ public void setDataOutdated() { @@ -371,9 +367,8 @@ public void setDataOutdated() { } /** - * Defines the value of the return type representation as outdated. It does - * forward this information recursively to all methods that are connected as - * receiver. + * Defines the value of the return type representation as outdated. It does forward this information recursively to + * all methods that are connected as receiver. */ public void setReturnTypeOutdated() { @@ -466,12 +461,10 @@ public void setParentMethod(DefaultMethodRepresentation parentMethod) { } /** - * Indicates wether return value is up to date or not. A return value - * usually is defined as up tp date if after the last assignment from method - * call none of the input values (their representations) changed. + * Indicates wether return value is up to date or not. A return value usually is defined as up tp date if after the + * last assignment from method call none of the input values (their representations) changed. * - * @return true if return value is up to date; - * false otherwise + * @return true if return value is up to date; false otherwise */ public boolean isReturnTypeUpToDate() { boolean result = false; @@ -486,8 +479,7 @@ public boolean isReturnTypeUpToDate() { /** * Indikates whether type representation is up to date. * - * @return true if return value is up to date; - * false otherwise + * @return true if return value is up to date; false otherwise */ protected boolean isUpToDate() { boolean result = this.upToDate; @@ -500,12 +492,10 @@ protected boolean isUpToDate() { } /** - * Defines whether the value is up to date or not. A return value usually is - * defined as up tp date if after the last assignment from method call none - * of the input values (their representations) changed. + * Defines whether the value is up to date or not. A return value usually is defined as up tp date if after the last + * assignment from method call none of the input values (their representations) changed. * - * @param upToDate true if return value is to be defined as up - * to date; false otherwise + * @param upToDate true if return value is to be defined as up to date; false otherwise */ public void setUpToDate(boolean upToDate) { this.upToDate = upToDate; @@ -521,8 +511,7 @@ protected void validateValue() { } /** - * Defines the type representation as invalid (because of incorrect or - * missing input) + * Defines the type representation as invalid (because of incorrect or missing input) */ protected void invalidateValue() { if (!isNoValidation()) { @@ -531,16 +520,14 @@ protected void invalidateValue() { } /** - * Will be called if the type representation is valid (input value is - * correct). + * Will be called if the type representation is valid (input value is correct). */ protected void valueValidated() { // default does not have an effect } /** - * Will be called if the type representation is invalid (because of - * incorrect or missing input). + * Will be called if the type representation is invalid (because of incorrect or missing input). */ protected void valueInvalidated() { // default does not have an effect @@ -667,8 +654,7 @@ protected void newCanvasAssigned(Canvas oldCanvas, Canvas newCanvas) { /** * Indicates whether the representation value is valid. * - * @return true if the representation value is valid; - * false otherwise + * @return true if the representation value is valid; false otherwise */ public boolean isValidValue() { return validValue; @@ -700,8 +686,7 @@ public void setValidValue(boolean validValue) { } /** - * Evaluates the contract, e.g., checks for correct data type or range - * condition. + * Evaluates the contract, e.g., checks for correct data type or range condition. */ protected void evaluateContract() { Connector valueConnector = null; @@ -743,8 +728,7 @@ protected void evaluateContract() { } /** - * Defines the message to show if the input data is invalid. Override this - * method to define a custom message. + * Defines the message to show if the input data is invalid. Override this method to define a custom message. * * @return the message to show if the input data is invalid */ @@ -755,8 +739,7 @@ protected Message getInvalidInputDataMessage() { } /** - * Defines the message to show if the input data is empty. verride this - * method to define a custom message + * Defines the message to show if the input data is empty. verride this method to define a custom message * * @return the message to show if the input data is empty */ @@ -769,12 +752,14 @@ protected Message getEmptyInputDataMessage() { @Override public void setValue(final Object o) { - VSwingUtil.invokeLater(new Runnable() { - @Override - public void run() { - emptyView(); - } - }); + if (!skipEmptyViewCallInSetValue&&o!=null) { + VSwingUtil.invokeLater(new Runnable() { + @Override + public void run() { + emptyView(); + } + }); + } value = o; @@ -1051,9 +1036,8 @@ public ArrayList getInputDocument() { } /** - * Defines the input document and the input component of this - * representation. Calling this method will enable layout updating on - * document changes for the specified input component. + * Defines the input document and the input component of this representation. Calling this method will enable layout + * updating on document changes for the specified input component. * * @param input the input component * @param inputDocuments the input documents to set @@ -1068,27 +1052,27 @@ public void setInputDocument(final JComponent input, d.addDocumentListener( new DocumentListener() { - @Override - public void insertUpdate(DocumentEvent e) { - setDataOutdated(); - updateLayout(); + @Override + public void insertUpdate(DocumentEvent e) { + setDataOutdated(); + updateLayout(); // getMainCanvas().getEffectPane().pulse(getConnector(), // MessageType.INFO_SINGLE); - } + } - @Override - public void removeUpdate(DocumentEvent e) { - setDataOutdated(); - updateLayout(); + @Override + public void removeUpdate(DocumentEvent e) { + setDataOutdated(); + updateLayout(); // getMainCanvas().getEffectPane().pulse(getConnector(), // MessageType.INFO_SINGLE); - } + } - @Override - public void changedUpdate(DocumentEvent e) { - // - } - }); + @Override + public void changedUpdate(DocumentEvent e) { + // + } + }); } } @@ -1106,42 +1090,40 @@ public void setInputDocument(Document... inputDocuments) { d.addDocumentListener( new DocumentListener() { - @Override - public void insertUpdate(DocumentEvent e) { - setDataOutdated(); + @Override + public void insertUpdate(DocumentEvent e) { + setDataOutdated(); // getMainCanvas().getEffectPane().pulse(getConnector(), // MessageType.INFO_SINGLE); - } + } - @Override - public void removeUpdate(DocumentEvent e) { - setDataOutdated(); + @Override + public void removeUpdate(DocumentEvent e) { + setDataOutdated(); // getMainCanvas().getEffectPane().pulse(getConnector(), // MessageType.INFO_SINGLE); - } + } - @Override - public void changedUpdate(DocumentEvent e) { - // - } - }); + @Override + public void changedUpdate(DocumentEvent e) { + // + } + }); } } /** * Returns the input component of this type representation. * - * @return the input component of this type representation or - * null if no such component is defined + * @return the input component of this type representation or null if no such component is defined */ public JComponent getInputComponent() { return inputComponent; } /** - * Defines the input component of this representation. Input components can - * dynamically change their size. The representation and its parents also - * update their size if that is necessary + * Defines the input component of this representation. Input components can dynamically change their size. The + * representation and its parents also update their size if that is necessary * * @param inputComponent the input component to set */ @@ -1152,8 +1134,7 @@ public void setInputComponent(JComponent inputComponent) { /** * Indicates whether null is a valid value. * - * @return true if null is a valid value; - * false otherwise + * @return true if null is a valid value; false otherwise */ public boolean isNullValidInput() { return nullValidInput; @@ -1171,8 +1152,7 @@ public void setNullValidInput(boolean nullValidInput) { /** * Indicates whether are value validation is disabled. * - * @return true if value valudation is disabled; - * false otherwise + * @return true if value valudation is disabled; false otherwise */ protected boolean isNoValidation() { return noValidation; @@ -1222,12 +1202,11 @@ public void setSelected(boolean selected) { } /** - * Returns the topmost parent of this representation that is instance of a - * given class object. + * Returns the topmost parent of this representation that is instance of a given class object. * * @param cl the class object - * @return the topmost parent of this representation that is instance of a - * given class object or null if no such parent exists + * @return the topmost parent of this representation that is instance of a given class object or null + * if no such parent exists */ public Component getParentOfClass(Class cl) { @@ -1368,6 +1347,17 @@ public void evaluateValueOptions() { if (property != null) { serialization = (boolean) (Boolean) property; } + + property = null; + + if (getValueOptions().contains("skipEmptyViewCallInSetValue")) { + property = getOptionEvaluator().getProperty("skipEmptyViewCallInSetValue"); + } + + if (property != null) { + setSkipEmptyViewCallInSetValue((boolean) (Boolean) property); + } + } catch (Exception ex) { if (getMainCanvas() != null) { @@ -1391,15 +1381,12 @@ public void evaluateValueOptions() { /** * Requests evaluation of the value options that are usually specified in - * {@link eu.mihosoft.vrl.annotation.ParamInfo}. This method should be - * overloaded in custom type representations if they depend on custom value - * options. + * {@link eu.mihosoft.vrl.annotation.ParamInfo}. This method should be overloaded in custom type representations if + * they depend on custom value options. *

- * Note: if a custom class does not directly extend - * {@link TypeRepresentationBase}, e.g., if it derives - * {@link BufferedImageType} it is necessary to call the super method before - * performing the custom evaluation as these classes implement this method - * as well.

+ * Note: if a custom class does not directly extend {@link TypeRepresentationBase}, e.g., if it derives + * {@link BufferedImageType} it is necessary to call the super method before performing the custom evaluation as + * these classes implement this method as well.

* *

* Sample Code:

@@ -1430,8 +1417,8 @@ protected void evaluationRequest(Script script) { * Defines whether to hide the conector of this type representation. *

*

- * Note: This method does not fire action events etc to notify the - * value options about the visibility state.

+ * Note: This method does not fire action events etc to notify the value options about the visibility state. + *

* * @param state the state to set */ @@ -1446,16 +1433,15 @@ public void setHideConnector(boolean state) { /** * Indicates whether to hide the connector of this type representation. * - * @return the true if the connector shall be hidden; - * false otherwise + * @return the true if the connector shall be hidden; false otherwise */ public boolean isHideConnector() { return hideConnector; } /** - * Disposes additional resources, e.g., Java 3D render threads. It will be - * called when the parent canvas window is closed. + * Disposes additional resources, e.g., Java 3D render threads. It will be called when the parent canvas window is + * closed. */ @Override public void dispose() { @@ -1514,13 +1500,11 @@ public void setCustomData(CustomParamData customData) { } /** - * This method will be called when custom param data has been loaded from - * file. Override this method to handle custom read operations or to convert - * the data to custom data structures. + * This method will be called when custom param data has been loaded from file. Override this method to handle + * custom read operations or to convert the data to custom data structures. *

- * Note: changes to the data other than loading will not trigger this - * method. If a change notification is required, a custom solution must be - * provided.

+ * Note: changes to the data other than loading will not trigger this method. If a change notification is + * required, a custom solution must be provided.

*/ public void evaluateCustomParamData() { // @@ -1537,8 +1521,8 @@ public RepresentationType getCurrentRepresentationType() { } /** - * The capability changed listeners of this window. To add listeners use the - * null null null null null null null null null null {@link CanvasWindow#addCapabilityListener( + * The capability changed listeners of this window. To add listeners use the null null null null null null null null + * null null null {@link CanvasWindow#addCapabilityListener( * eu.mihosoft.vrl.visual.CapabilityChangedListener)} instead. * * @return the capabilityChangedListeners @@ -1548,9 +1532,8 @@ public ArrayList getCapabilityChangedListeners() { } /** - * Adds a capability changed listener to the capability manager. The - * listener will be removed if the dispose() method of this - * window is called. + * Adds a capability changed listener to the capability manager. The listener will be removed if the + * dispose() method of this window is called. * * @param listener the listener to add */ @@ -1563,9 +1546,8 @@ public void addCapabilityListener(CapabilityChangedListener listener) { } /** - * This method is called after this typerepresentation has been added to a - * method representation (including setting connector etc.). It may be used - * to perform custom initialization based on option evaluation etc. + * This method is called after this typerepresentation has been added to a method representation (including setting + * connector etc.). It may be used to perform custom initialization based on option evaluation etc. */ public void addedToMethodRepresentation() { // @@ -1616,11 +1598,9 @@ public boolean isFullScreenMode() { } /** - * Indicates whether this type representation is connected via data - * connection. + * Indicates whether this type representation is connected via data connection. * - * @return true if this type representation is connected; - * false otherwise + * @return true if this type representation is connected; false otherwise */ public boolean isConnected() { return getMainCanvas(). @@ -1658,27 +1638,22 @@ public String getValueAsCode() { } /** - * Indicates whether to prefer binary serialization over XML encoding. - * Sometimes it is very time consuming to encode via XML, e.g. for - * Collection types such as {@link java.util.ArrayList} as for each of the - * entries in the list an XML tag is used. Thus, a criterion might be the - * list size. + * Indicates whether to prefer binary serialization over XML encoding. Sometimes it is very time consuming to encode + * via XML, e.g. for Collection types such as {@link java.util.ArrayList} as for each of the entries in the list an + * XML tag is used. Thus, a criterion might be the list size. * - * @return true if binary serialization is prefered; - * false otherwise + * @return true if binary serialization is prefered; false otherwise */ public boolean preferBinarySerialization() { return false; } /** - * Indicates whether to prevent value serialization. Sometimes the value may - * be too big or unimportant to be saved. This property can be controlled - * via the variable serialization in the options string of the - * param info. + * Indicates whether to prevent value serialization. Sometimes the value may be too big or unimportant to be saved. + * This property can be controlled via the variable serialization in the options string of the param + * info. * - * @return true if the value shall not be serialized; - * false otherwise + * @return true if the value shall not be serialized; false otherwise */ public boolean noSerialization() { @@ -1695,17 +1670,15 @@ public boolean noSerialization() { /** * Indicates whether this type representation shall be visualized. * - * @return true if this type representation shall not be - * visualized; false otherwise + * @return true if this type representation shall not be visualized; false otherwise */ public boolean isNoGUI() { return noGUI; } /** - * Defines whether this type representation shall be visualized. Usually, - * values are visualized. This is the preferred behavior. But there are some - * cases where it is preferable to completely hide this type representation + * Defines whether this type representation shall be visualized. Usually, values are visualized. This is the + * preferred behavior. But there are some cases where it is preferable to completely hide this type representation * from the GUI. One use case is {@link GetVisualIDType}. * * @param noGUI the state to set @@ -1719,13 +1692,12 @@ protected VClassLoader getCanvasClassLoader() { } /** - * Indicates whether this type representation is compatible to a given type - * representation. It is assumed that this type representation (where the - * method is called from) is an input type representation. + * Indicates whether this type representation is compatible to a given type representation. It is assumed that this + * type representation (where the method is called from) is an input type representation. * * @param tRep the type representation to check - * @return true if this type representation is compatible to - * the given type representation; false otherwise + * @return true if this type representation is compatible to the given type representation; + * false otherwise */ protected ConnectionResult compatible(TypeRepresentationBase tRep) { @@ -1830,7 +1802,6 @@ public void setParamInfo(ParamInfo paramInfo) { *

* Note:May be overridden by custom param options.

* - * @param serialization the serialization to set */ public void enableSerialization() { this.serialization = true; @@ -1841,9 +1812,30 @@ public void enableSerialization() { *

* Note:May be overridden by custom param options.

* - * @param serialization the serialization to set */ public void disableSerialization() { this.serialization = false; } + + /** + * Defines whether to skip {@link TypeRepresentation#emptyView()} call in + * {@link TypeRepresentation#setValue(java.lang.Object) } if the object to visualize is not null. + * + * @param skip value which determins whether to skip + */ + protected void setSkipEmptyViewCallInSetValue(boolean skip) { + this.skipEmptyViewCallInSetValue = skip; + } + + /** + * Indicates whether {@link TypeRepresentation#emptyView()} call is skipped in + * {@link TypeRepresentation#setValue(java.lang.Object) } if the object to visualize is not null. + * + * @return {@code true} if skipped; {@code false} otherwise + */ + protected boolean isSkipEmptyViewCallInSetValue() { + return skipEmptyViewCallInSetValue; + } + + } diff --git a/VRL/src/eu/mihosoft/vrl/resources/changelog/changelog.txt b/VRL/src/eu/mihosoft/vrl/resources/changelog/changelog.txt index e508ea70..24138244 100644 --- a/VRL/src/eu/mihosoft/vrl/resources/changelog/changelog.txt +++ b/VRL/src/eu/mihosoft/vrl/resources/changelog/changelog.txt @@ -1,3 +1,16 @@ +----------------------------------------------- +Version: v0.4.3.1.0 +Date: Wed, 9 Nov 2016 18:53:00 +0100 +----------------------------------------------- + + - experimental OpenGL based rendering (optional) + - improved support for JDK 8 (tested with JDK 8u102) + - projects are finally compiled with JDK8 compatible + bytecode (improves indy) + - updated to groovy to 2.4.7 + - updated to ant to 1.9.x + - ... + ----------------------------------------------- Version: v0.4.3.0.2 Date: Thu, 5 Nov 2015 12:54:47 +0100 @@ -182,6 +195,14 @@ Date: Mon, 5 Nov 2012 14:05:50 +0100 - groovyfunction types in math package can autogenerate session code - var names are validated (session code compilation cannot be broken through incorrect names) +----------------------------------------------- +Version: PhDThesisMiHo2016 +Date: Fri, 5 Aug 2016 16:51:22 +0200 +----------------------------------------------- + + Final version for PhD thesis. +  + --- [PRE GITHUB] --- diff --git a/VRL/src/eu/mihosoft/vrl/system/Constants.java b/VRL/src/eu/mihosoft/vrl/system/Constants.java index 515077cc..908c2c46 100644 --- a/VRL/src/eu/mihosoft/vrl/system/Constants.java +++ b/VRL/src/eu/mihosoft/vrl/system/Constants.java @@ -1,131 +1,131 @@ -/* - * Constants.java - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright (c) 2009-2012 Steinbeis Forschungszentrum (STZ ??lbronn), - * Copyright (c) 2006-2012 by Michael Hoffer - * - * This file is part of Visual Reflection Library (VRL). - * - * VRL is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * as published by the Free Software Foundation. - * - * see: http://opensource.org/licenses/LGPL-3.0 - * file://path/to/VRL/src/eu/mihosoft/vrl/resources/license/lgplv3.txt - * - * VRL is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * This version of VRL includes copyright notice and attribution requirements. - * According to the LGPL this information must be displayed even if you modify - * the source code of VRL. Neither the VRL Canvas attribution icon nor any - * copyright statement/attribution may be removed. - * - * Attribution Requirements: - * - * If you create derived work you must do three things regarding copyright - * notice and author attribution. - * - * First, the following text must be displayed on the Canvas: - * "based on VRL source code". In this case the VRL canvas icon must be removed. - * - * Second, the copyright notice must remain. It must be reproduced in any - * program that uses VRL. - * - * Third, add an additional notice, stating that you modified VRL. In addition - * you must cite the publications listed below. A suitable notice might read - * "VRL source code modified by YourName 2012". - * - * Note, that these requirements are in full accordance with the LGPL v3 - * (see 7. Additional Terms, b). - * - * Publications: - * - * M. Hoffer, C.Poliwoda, G.Wittum. Visual Reflection Library - - * A Framework for Declarative GUI Programming on the Java Platform. - * Computing and Visualization in Science, 2011, in press. - */ -package eu.mihosoft.vrl.system; - -import eu.mihosoft.vrl.io.VPropertyFolderManager; -import eu.mihosoft.vrl.io.vrlx.CompatibleFileVersionInfo; -import eu.mihosoft.vrl.io.vrlx.FileVersionInfo; -import eu.mihosoft.vrl.visual.Message; - -/** - * System and Version Constants. - * - * @author Michael Hoffer <info@michaelhoffer.de> - */ -public class Constants { - - /** - * Major version specifies the major version of VRL. Changes of this - * variable indicate incompatible versions. Thus, for each major version, a - * custom property folder will be generated. - */ - public static final String VERSION_MAJOR = "0.4.3"; - /** - * VRL version number that indicates major and minor changes. - */ - public static final String VERSION_BASE = VERSION_MAJOR + ".1.0"; - // "-HEAD" or "-unstable" or "" for release etc. - public static final String VERSION_SUFFIX = "-HEAD"; - // full version (base+suffix+date) - public static final String VERSION = - VERSION_BASE + VERSION_SUFFIX - + ", build: " +/**/""/**/; - /** - * Copyright statement. - */ - public static final String COPYRIGHT = - "2006-" + /**/"2016"/**/ + " by Michael Hoffer <info@michaelhoffer.de>"; - /** - * Simple copyright statement (usefull for windows titles etc.) - */ - public static final String COPYRIGHT_SIMPLE = - "2006-" + /**/"2016"/**/ + " by Michael Hoffer"; - /** - * Defines which projects can be processed by this version of VRL. - */ - public static CompatibleFileVersionInfo fileVersionCompatibility = - new CompatibleFileVersionInfo( - new FileVersionInfo(VERSION_BASE, - "created by VRL version " + VERSION), // current version - new FileVersionInfo("0.4.0", ""), // min version - new FileVersionInfo(VERSION_MAJOR, "")); // max version - /** - * VRL developers. - */ - public static final String DEVELOPERS = - "Michael Hoffer <info@michaelhoffer.de>"; - /** - * String that contains - * "write a VRL bug report to $DEVELOPERS" (HTML) - */ - public static final String WRITE_VRL_BUG_REPORT = "write a VRL bug report to " - + Message.EMPHASIZE_BEGIN + DEVELOPERS + Message.EMPHASIZE_END; - /** - * String that contains - * "write a VRL bug report to $DEVELOPERS" (plain text) - */ - public static final String WRITE_VRL_BUG_REPORT_PLAIN = - "write a VRL bug report to " + DEVELOPERS; - /** - * Library folder name. - */ - public static final String LIB_DIR = "lib/"; - /** - * Custom library folder name. - */ - public static final String CUSTOM_LIB_DIR = "custom-lib/"; - /** - * Plugin folder (changed at run-time). Note: please use - * {@link VPropertyFolderManager} to access the plugin folder. - */ - public static String PLUGIN_DIR; -} +/* + * Constants.java + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright (c) 2009-2012 Steinbeis Forschungszentrum (STZ ??lbronn), + * Copyright (c) 2006-2012 by Michael Hoffer + * + * This file is part of Visual Reflection Library (VRL). + * + * VRL is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * as published by the Free Software Foundation. + * + * see: http://opensource.org/licenses/LGPL-3.0 + * file://path/to/VRL/src/eu/mihosoft/vrl/resources/license/lgplv3.txt + * + * VRL is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * This version of VRL includes copyright notice and attribution requirements. + * According to the LGPL this information must be displayed even if you modify + * the source code of VRL. Neither the VRL Canvas attribution icon nor any + * copyright statement/attribution may be removed. + * + * Attribution Requirements: + * + * If you create derived work you must do three things regarding copyright + * notice and author attribution. + * + * First, the following text must be displayed on the Canvas: + * "based on VRL source code". In this case the VRL canvas icon must be removed. + * + * Second, the copyright notice must remain. It must be reproduced in any + * program that uses VRL. + * + * Third, add an additional notice, stating that you modified VRL. In addition + * you must cite the publications listed below. A suitable notice might read + * "VRL source code modified by YourName 2012". + * + * Note, that these requirements are in full accordance with the LGPL v3 + * (see 7. Additional Terms, b). + * + * Publications: + * + * M. Hoffer, C.Poliwoda, G.Wittum. Visual Reflection Library - + * A Framework for Declarative GUI Programming on the Java Platform. + * Computing and Visualization in Science, 2011, in press. + */ +package eu.mihosoft.vrl.system; + +import eu.mihosoft.vrl.io.VPropertyFolderManager; +import eu.mihosoft.vrl.io.vrlx.CompatibleFileVersionInfo; +import eu.mihosoft.vrl.io.vrlx.FileVersionInfo; +import eu.mihosoft.vrl.visual.Message; + +/** + * System and Version Constants. + * + * @author Michael Hoffer <info@michaelhoffer.de> + */ +public class Constants { + + /** + * Major version specifies the major version of VRL. Changes of this + * variable indicate incompatible versions. Thus, for each major version, a + * custom property folder will be generated. + */ + public static final String VERSION_MAJOR = "0.4.3"; + /** + * VRL version number that indicates major and minor changes. + */ + public static final String VERSION_BASE = VERSION_MAJOR + ".1.0"; + // "-HEAD" or "-unstable" or "" for release etc. + public static final String VERSION_SUFFIX = "-HEAD"; + // full version (base+suffix+date) + public static final String VERSION = + VERSION_BASE + VERSION_SUFFIX + + ", build: " +/**/""/**/; + /** + * Copyright statement. + */ + public static final String COPYRIGHT = + "2006-" + /**/"2017"/**/ + " by Michael Hoffer <info@michaelhoffer.de>"; + /** + * Simple copyright statement (usefull for windows titles etc.) + */ + public static final String COPYRIGHT_SIMPLE = + "2006-" + /**/"2017"/**/ + " by Michael Hoffer"; + /** + * Defines which projects can be processed by this version of VRL. + */ + public static CompatibleFileVersionInfo fileVersionCompatibility = + new CompatibleFileVersionInfo( + new FileVersionInfo(VERSION_BASE, + "created by VRL version " + VERSION), // current version + new FileVersionInfo("0.4.0", ""), // min version + new FileVersionInfo(VERSION_MAJOR, "")); // max version + /** + * VRL developers. + */ + public static final String DEVELOPERS = + "Michael Hoffer <info@michaelhoffer.de>"; + /** + * String that contains + * "write a VRL bug report to $DEVELOPERS" (HTML) + */ + public static final String WRITE_VRL_BUG_REPORT = "write a VRL bug report to " + + Message.EMPHASIZE_BEGIN + DEVELOPERS + Message.EMPHASIZE_END; + /** + * String that contains + * "write a VRL bug report to $DEVELOPERS" (plain text) + */ + public static final String WRITE_VRL_BUG_REPORT_PLAIN = + "write a VRL bug report to " + DEVELOPERS; + /** + * Library folder name. + */ + public static final String LIB_DIR = "lib/"; + /** + * Custom library folder name. + */ + public static final String CUSTOM_LIB_DIR = "custom-lib/"; + /** + * Plugin folder (changed at run-time). Note: please use + * {@link VPropertyFolderManager} to access the plugin folder. + */ + public static String PLUGIN_DIR; +}