diff --git a/praxiscore-code/src/main/java/org/praxislive/code/userapi/AuxIn.java b/praxiscore-code/src/main/java/org/praxislive/code/userapi/AuxIn.java index 7acd1e86..d2e87027 100644 --- a/praxiscore-code/src/main/java/org/praxislive/code/userapi/AuxIn.java +++ b/praxiscore-code/src/main/java/org/praxislive/code/userapi/AuxIn.java @@ -1,7 +1,7 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright 2018 Neil C Smith. + * Copyright 2023 Neil C Smith. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License version 3 only, as @@ -19,7 +19,6 @@ * Please visit https://www.praxislive.org if you need additional information or * have any questions. */ - package org.praxislive.code.userapi; import java.lang.annotation.ElementType; @@ -28,22 +27,20 @@ import java.lang.annotation.Target; /** - * Annotate a field or method representing an auxiliary input, such as an {@link Input} - * or a method with single parameter. A port will be created on the component. - * Auxiliary inputs show after inputs, outputs, properties and triggers. - *

- * The value gives the relative position compared to other @AuxIn elements. - * Values must be unique. They do not have to be contiguous. + * Annotate a field or method representing an auxiliary input, such as an + * {@link Input} or a method with single parameter. A port will be created on + * the component. */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.FIELD, ElementType.METHOD}) public @interface AuxIn { /** - * Relative position compared to other @AuxIn elements. Values must be unique. - * They do not have to be contiguous. - * - * @return position + * Relative weight compared to other @AuxIn elements. Elements will be + * sorted by weight, and then alphabetically. Higher weight elements will + * sort after lower weight elements. + * + * @return weight */ - int value(); + int value() default 0; } diff --git a/praxiscore-code/src/main/java/org/praxislive/code/userapi/AuxOut.java b/praxiscore-code/src/main/java/org/praxislive/code/userapi/AuxOut.java index a6359f91..2ad564f7 100644 --- a/praxiscore-code/src/main/java/org/praxislive/code/userapi/AuxOut.java +++ b/praxiscore-code/src/main/java/org/praxislive/code/userapi/AuxOut.java @@ -1,7 +1,7 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright 2018 Neil C Smith. + * Copyright 2023 Neil C Smith. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License version 3 only, as @@ -19,7 +19,6 @@ * Please visit https://www.praxislive.org if you need additional information or * have any questions. */ - package org.praxislive.code.userapi; import java.lang.annotation.ElementType; @@ -28,22 +27,20 @@ import java.lang.annotation.Target; /** - * Annotate a field representing an auxiliary output, such as {@link Output}. A + * Annotate a field representing an auxiliary output, such as {@link Output}. A * port will be created on the component. Auxiliary outputs show after inputs, * outputs, properties, triggers and auxiliary inputs. - *

- * The value gives the relative position compared to other @AuxOut elements. - * Values must be unique. They do not have to be contiguous. */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.FIELD, ElementType.METHOD}) public @interface AuxOut { /** - * Relative position compared to other @AuxOut elements. Values must be unique. - * They do not have to be contiguous. - * - * @return + * Relative weight compared to other @AuxOut elements. Elements will be + * sorted by weight, and then alphabetically. Higher weight elements will + * sort after lower weight elements. + * + * @return weight */ - int value(); + int value() default 0; } diff --git a/praxiscore-code/src/main/java/org/praxislive/code/userapi/FN.java b/praxiscore-code/src/main/java/org/praxislive/code/userapi/FN.java index babead0c..445c529e 100644 --- a/praxiscore-code/src/main/java/org/praxislive/code/userapi/FN.java +++ b/praxiscore-code/src/main/java/org/praxislive/code/userapi/FN.java @@ -1,7 +1,7 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright 2022 Neil C Smith. + * Copyright 2023 Neil C Smith. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License version 3 only, as @@ -36,7 +36,8 @@ /** * Relative weight compared to other @FN elements. Functions will be sorted - * by weight, and then alphabetically. + * by weight, and then alphabetically. Higher weight elements will sort + * after lower weight elements. * * @return weight */ diff --git a/praxiscore-code/src/main/java/org/praxislive/code/userapi/In.java b/praxiscore-code/src/main/java/org/praxislive/code/userapi/In.java index d5d0b793..61405596 100644 --- a/praxiscore-code/src/main/java/org/praxislive/code/userapi/In.java +++ b/praxiscore-code/src/main/java/org/praxislive/code/userapi/In.java @@ -1,7 +1,7 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright 2018 Neil C Smith. + * Copyright 2023 Neil C Smith. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License version 3 only, as @@ -27,22 +27,20 @@ import java.lang.annotation.Target; /** - * Annotate a field or method representing an input, such as an {@link Input} or a method - * with single parameter. A port will be created on the component. Inputs show first on the - * component. - *

- * The value gives the relative position compared to other @In elements. Values - * must be unique. They do not have to be contiguous. + * Annotate a field or method representing an input, such as an {@link Input} or + * a method with single parameter. A port will be created on the component. + * Inputs show first on the component. */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.FIELD, ElementType.METHOD}) public @interface In { /** - * Relative position compared to other @In elements. Values must be unique. - * They do not have to be contiguous. + * Relative weight compared to other @In elements. Elements will be sorted + * by weight, and then alphabetically. Higher weight elements will sort + * after lower weight elements. * - * @return position + * @return weight */ - int value(); + int value() default 0; } diff --git a/praxiscore-code/src/main/java/org/praxislive/code/userapi/Out.java b/praxiscore-code/src/main/java/org/praxislive/code/userapi/Out.java index 8ae7dd5d..465be92b 100644 --- a/praxiscore-code/src/main/java/org/praxislive/code/userapi/Out.java +++ b/praxiscore-code/src/main/java/org/praxislive/code/userapi/Out.java @@ -1,7 +1,7 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright 2018 Neil C Smith. + * Copyright 2023 Neil C Smith. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License version 3 only, as @@ -19,7 +19,6 @@ * Please visit https://www.praxislive.org if you need additional information or * have any questions. */ - package org.praxislive.code.userapi; import java.lang.annotation.ElementType; @@ -28,14 +27,19 @@ import java.lang.annotation.Target; /** - * Annotate a field representing an output, such as {@link Output}. A port will be - * created on the component. Outputs show after inputs. - *

- * The value gives the relative position compared to other @Out elements. - * Values must be unique. They do not have to be contiguous. + * Annotate a field representing an output, such as {@link Output}. A port will + * be created on the component. Outputs show after inputs. */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.FIELD, ElementType.METHOD}) public @interface Out { - int value(); + + /** + * Relative weight compared to other @Out elements. Elements will be sorted + * by weight, and then alphabetically. Higher weight elements will sort + * after lower weight elements. + * + * @return weight + */ + int value() default 0; } diff --git a/praxiscore-code/src/main/java/org/praxislive/code/userapi/P.java b/praxiscore-code/src/main/java/org/praxislive/code/userapi/P.java index ec9e6c57..c7af6e06 100644 --- a/praxiscore-code/src/main/java/org/praxislive/code/userapi/P.java +++ b/praxiscore-code/src/main/java/org/praxislive/code/userapi/P.java @@ -1,7 +1,7 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright 2018 Neil C Smith. + * Copyright 2023 Neil C Smith. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License version 3 only, as @@ -19,7 +19,6 @@ * Please visit https://www.praxislive.org if you need additional information or * have any questions. */ - package org.praxislive.code.userapi; import java.lang.annotation.ElementType; @@ -28,36 +27,39 @@ import java.lang.annotation.Target; /** - * Annotate a field as a property. A control and port will be automatically created - * so that values of the field can be queried or set from the UI or other components. - * Field values will also be stored in the project, and available when copying or - * exporting, unless the field is read-only or transient. + * Annotate a field as a property. A control and port will be automatically + * created so that values of the field can be queried or set from the UI or + * other components. Field values will also be stored in the project, and + * available when copying or exporting, unless the field is read-only or + * transient. *

- * The @P annotation may be used on fields of type {@link Property}, - * or any field type that can be backed by a Property - String, double, float, int, boolean, - * PArray, PBytes, any enum, any Serializable implementation, or a List of Serializable - * subclasses. + * The @P annotation may be used on fields of type {@link Property}, or any + * field type that can be backed by a Property, such as String, double, float, + * int, boolean, any Value type, any enum, etc. *

* The @P annotation can also be used on fields that represent a represent * loadable resource, in which case the port / control will accept a URL and the * field type will be the loaded resource. See specific custom code types for * what resources they support loading. *

- * Use the various {@link Type} annotations to set default values, allowed values, ranges, etc. - * Use {@link Port @Port} to suppress automatic creation of a port. - * Use {@link Transient @Transient} to stop the field value being saved as part of the project. - * Use {@link ReadOnly @ReadOnly} to stop the field being settable externally (it can - * still be set in code). + * Use the various {@link Type} annotations to set default values, allowed + * values, ranges, etc. Use {@link Config.Port @Config.Port(false)} to suppress + * automatic creation of a port. Use {@link Transient @Transient} to stop the + * field value being saved as part of the project. Use + * {@link ReadOnly @ReadOnly} to stop the field being settable externally (it + * can still be set in code). */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.FIELD) public @interface P { /** - * Relative position compared to other @P elements. Values must be unique. - * They do not have to be contiguous. + * Relative weight compared to other @P elements. Elements will be sorted by + * weight, and then alphabetically. Higher weight elements will sort after + * lower weight elements. * - * @return position + * @return weight */ - int value(); + int value() default 0; + }