MARMOTTA-419: removed 3rd-party source-code from the tree (and from N&L)
Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/60ae655a Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/60ae655a Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/60ae655a Branch: refs/heads/develop Commit: 60ae655ac8d185bb5b372f32cc077a53dc3c44b8 Parents: 0c8ccdb Author: Jakob Frank <[email protected]> Authored: Fri Jan 10 15:01:58 2014 +0100 Committer: Jakob Frank <[email protected]> Committed: Fri Jan 10 15:02:53 2014 +0100 ---------------------------------------------------------------------- LICENSE.txt | 71 - .../src/main/resources/installer/LICENSE.txt | 72 - launchers/marmotta-splash/pom.xml | 28 - .../src/ext/java/net/miginfocom/layout/AC.java | 564 ----- .../java/net/miginfocom/layout/BoundSize.java | 273 -- .../src/ext/java/net/miginfocom/layout/CC.java | 1833 -------------- .../net/miginfocom/layout/ComponentWrapper.java | 297 --- .../net/miginfocom/layout/ConstraintParser.java | 1464 ----------- .../net/miginfocom/layout/ContainerWrapper.java | 69 - .../net/miginfocom/layout/DimConstraint.java | 471 ---- .../ext/java/net/miginfocom/layout/Grid.java | 2350 ------------------ .../ext/java/net/miginfocom/layout/IDEUtil.java | 789 ------ .../miginfocom/layout/InCellGapProvider.java | 65 - .../src/ext/java/net/miginfocom/layout/LC.java | 1032 -------- .../net/miginfocom/layout/LayoutCallback.java | 77 - .../java/net/miginfocom/layout/LayoutUtil.java | 566 ----- .../java/net/miginfocom/layout/LinkHandler.java | 200 -- .../net/miginfocom/layout/PlatformDefaults.java | 772 ------ .../net/miginfocom/layout/ResizeConstraint.java | 92 - .../net/miginfocom/layout/UnitConverter.java | 59 - .../java/net/miginfocom/layout/UnitValue.java | 637 ----- .../java/net/miginfocom/swing/MigLayout.java | 701 ------ .../miginfocom/swing/SwingComponentWrapper.java | 459 ---- .../miginfocom/swing/SwingContainerWrapper.java | 109 - .../swingbits/action/ActionBuilderHelper.java | 241 -- .../action/ActionContainerBuilderFactory.java | 89 - .../swingbits/action/ActionDropDownMenu.java | 91 - .../org/oxbow/swingbits/action/ActionGroup.java | 131 - .../org/oxbow/swingbits/action/Actions.java | 83 - .../org/oxbow/swingbits/action/CheckAction.java | 39 - .../action/IActionContainerBuilder.java | 43 - .../org/oxbow/swingbits/action/RadioAction.java | 39 - .../org/oxbow/swingbits/action/dropdown.png | Bin 1227 -> 0 bytes .../swingbits/dialog/task/CommandLink.java | 104 - .../dialog/task/ContentDesignFactory.java | 55 - .../dialog/task/ICommandLinkPainter.java | 43 - .../swingbits/dialog/task/IContentDesign.java | 127 - .../oxbow/swingbits/dialog/task/TaskDialog.java | 968 -------- .../dialog/task/TaskDialogException.java | 53 - .../swingbits/dialog/task/TaskDialogs.java | 666 ----- .../dialog/task/design/CommandLinkButton.java | 147 -- .../task/design/CommandLinkButtonGroup.java | 53 - .../task/design/DefaultCommandLinkPainter.java | 162 -- .../task/design/DefaultContentDesign.java | 192 -- .../dialog/task/design/DetailsToggleButton.java | 49 - .../dialog/task/design/LinuxContentDesign.java | 75 - .../task/design/MacOsCommandLinkPainter.java | 48 - .../dialog/task/design/MacOsContentDesign.java | 137 - .../dialog/task/design/TaskDialogContent.java | 385 --- .../task/design/WindowsCommandLinkPainter.java | 65 - .../task/design/WindowsContentDesign.java | 66 - .../swingbits/list/ActionCheckListModel.java | 188 -- .../org/oxbow/swingbits/list/CheckList.java | 173 -- .../oxbow/swingbits/list/CheckListEditor.java | 84 - .../swingbits/list/CheckListFilterType.java | 31 - .../oxbow/swingbits/list/CheckListRenderer.java | 228 -- .../swingbits/list/DefaultCheckListModel.java | 175 -- .../oxbow/swingbits/list/ICheckListAction.java | 33 - .../oxbow/swingbits/list/ICheckListModel.java | 77 - .../oxbow/swingbits/misc/JSearchTextField.java | 72 - .../java/org/oxbow/swingbits/misc/search.png | Bin 851 -> 0 bytes .../org/oxbow/swingbits/popup/PopupWindow.java | 331 --- .../swingbits/table/TableHeaderRenderer.java | 77 - .../table/filter/AbstractTableFilter.java | 191 -- .../table/filter/DistinctColumnItem.java | 115 - .../table/filter/FilterTableHeaderRenderer.java | 103 - .../table/filter/IFilterChangeListener.java | 37 - .../swingbits/table/filter/ITableFilter.java | 99 - .../swingbits/table/filter/JTableFilter.java | 116 - .../filter/TableAwareCheckListRenderer.java | 86 - .../table/filter/TableFilterColumnPopup.java | 317 --- .../table/filter/TableFilterState.java | 129 - .../table/filter/TableRowFilterSupport.java | 166 -- .../org/oxbow/swingbits/table/filter/funnel.png | Bin 797 -> 0 bytes .../swingbits/table/filter/funnel_delete.png | Bin 906 -> 0 bytes .../oxbow/swingbits/util/CollectionUtils.java | 64 - .../java/org/oxbow/swingbits/util/DeepCopy.java | 94 - .../oxbow/swingbits/util/DeepCopyException.java | 57 - .../util/DefaultObjectToStringTranslator.java | 42 - .../util/IObjectToStringTranslator.java | 38 - .../org/oxbow/swingbits/util/IValueWrapper.java | 7 - .../java/org/oxbow/swingbits/util/Markup.java | 123 - .../oxbow/swingbits/util/OperatingSystem.java | 97 - .../org/oxbow/swingbits/util/Preconditions.java | 58 - .../org/oxbow/swingbits/util/Screenshot.java | 143 -- .../java/org/oxbow/swingbits/util/Strings.java | 102 - .../util/copy/FastByteArrayInputStream.java | 92 - .../util/copy/FastByteArrayOutputStream.java | 117 - .../swingbits/util/swing/AncestorAdapter.java | 51 - .../swingbits/util/swing/BeanProperty.java | 93 - .../swingbits/util/swing/CompoundIcon.java | 302 --- .../oxbow/swingbits/util/swing/EmptyIcon.java | 104 - .../org/oxbow/swingbits/util/swing/Icons.java | 98 - .../oxbow/swingbits/util/swing/SwingBean.java | 76 - .../src/ext/resources/META-INF/LICENSE | 208 -- .../src/ext/resources/META-INF/NOTICE | 11 - .../swingbits/dialog/task/arrowGreenRight.png | Bin 3526 -> 0 bytes .../swingbits/dialog/task/fewerDetails.png | Bin 933 -> 0 bytes .../swingbits/dialog/task/fewerDetailsMac.png | Bin 458 -> 0 bytes .../oxbow/swingbits/dialog/task/linux_error.png | Bin 1998 -> 0 bytes .../oxbow/swingbits/dialog/task/linux_info.png | Bin 2328 -> 0 bytes .../swingbits/dialog/task/linux_question.png | Bin 2671 -> 0 bytes .../swingbits/dialog/task/linux_warning.png | Bin 2169 -> 0 bytes .../oxbow/swingbits/dialog/task/moreDetails.png | Bin 912 -> 0 bytes .../swingbits/dialog/task/moreDetailsMac.png | Bin 468 -> 0 bytes .../src/main/resources/META-INF/LICENSE | 284 --- .../src/main/resources/META-INF/NOTICE | 11 - .../src/main/resources/task-dialog.properties | 34 - .../main/resources/task-dialog_de_DE.properties | 16 - .../main/resources/task-dialog_es_ES.properties | 16 - .../main/resources/task-dialog_fr_FR.properties | 16 - .../main/resources/task-dialog_it_IT.properties | 16 - .../main/resources/task-dialog_pl_PL.properties | 16 - .../main/resources/task-dialog_pt_BR.properties | 16 - .../main/resources/task-dialog_pt_PT.properties | 16 - .../main/resources/task-dialog_zh_CN.properties | 16 - .../src/main/webapp/META-INF/LICENSE | 72 - .../src/main/webapp/META-INF/LICENSE | 72 - 118 files changed, 22607 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/marmotta/blob/60ae655a/LICENSE.txt ---------------------------------------------------------------------- diff --git a/LICENSE.txt b/LICENSE.txt index f08ca02..7779dd8 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -398,77 +398,6 @@ external projects with separate copyright notices and license terms. Your use of the code for the these subcomponents is subject to the terms and conditions of the following licenses. -For the MigLayout component, - - located at: - launchers/marmotta-splash/src/ext/java - - Copyright (c) 2004 MiG InfoCom AB, http://www.migcalendar.com/miglayout - - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - 3. Neither the name of the MiG InfoCom AB nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - THE POSSIBILITY OF SUCH DAMAGE. - - -For the SwingBits component, - - located at: - launchers/marmotta-splash/src/ext/java - - Copyright (c) 2006 EzWare, http://swingbits.sourceforge.net - - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - 3. Neither the name of the EzWare nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - THE POSSIBILITY OF SUCH DAMAGE. - For the ROME component, http://git-wip-us.apache.org/repos/asf/marmotta/blob/60ae655a/launchers/marmotta-installer/src/main/resources/installer/LICENSE.txt ---------------------------------------------------------------------- diff --git a/launchers/marmotta-installer/src/main/resources/installer/LICENSE.txt b/launchers/marmotta-installer/src/main/resources/installer/LICENSE.txt index 7dbafbf..ac64adc 100644 --- a/launchers/marmotta-installer/src/main/resources/installer/LICENSE.txt +++ b/launchers/marmotta-installer/src/main/resources/installer/LICENSE.txt @@ -2537,78 +2537,6 @@ external projects with separate copyright notices and license terms. Your use of the code for the these subcomponents is subject to the terms and conditions of the following licenses. -For the MigLayout component, - - located at: - launchers/marmotta-splash/src/ext/java - - Copyright (c) 2004 MiG InfoCom AB, http://www.migcalendar.com/miglayout - - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - 3. Neither the name of the MiG InfoCom AB nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - THE POSSIBILITY OF SUCH DAMAGE. - - -For the SwingBits component, - - located at: - launchers/marmotta-splash/src/ext/java - - Copyright (c) 2006 EzWare, http://swingbits.sourceforge.net - - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - 3. Neither the name of the EzWare nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - THE POSSIBILITY OF SUCH DAMAGE. - - For the ROME component, located at: http://git-wip-us.apache.org/repos/asf/marmotta/blob/60ae655a/launchers/marmotta-splash/pom.xml ---------------------------------------------------------------------- diff --git a/launchers/marmotta-splash/pom.xml b/launchers/marmotta-splash/pom.xml index 4b1e73f..b13ea48 100644 --- a/launchers/marmotta-splash/pom.xml +++ b/launchers/marmotta-splash/pom.xml @@ -50,32 +50,4 @@ </dependency> </dependencies> - <build> - <plugins> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>build-helper-maven-plugin</artifactId> - <executions> - <execution> - <phase>generate-sources</phase> - <goals><goal>add-source</goal></goals> - <configuration> - <sources> - <source>src/ext/java</source> - </sources> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - <resources> - <resource> - <directory>src/main/resources</directory> - </resource> - <resource> - <directory>src/ext/resources</directory> - </resource> - </resources> - </build> - </project> http://git-wip-us.apache.org/repos/asf/marmotta/blob/60ae655a/launchers/marmotta-splash/src/ext/java/net/miginfocom/layout/AC.java ---------------------------------------------------------------------- diff --git a/launchers/marmotta-splash/src/ext/java/net/miginfocom/layout/AC.java b/launchers/marmotta-splash/src/ext/java/net/miginfocom/layout/AC.java deleted file mode 100644 index c526ef4..0000000 --- a/launchers/marmotta-splash/src/ext/java/net/miginfocom/layout/AC.java +++ /dev/null @@ -1,564 +0,0 @@ -package net.miginfocom.layout; - -import java.io.*; -import java.util.ArrayList; - -/* - * License (BSD): - * ============== - * - * Copyright (c) 2004, Mikael Grev, MiG InfoCom AB. (miglayout (at) miginfocom (dot) com) - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright notice, this list - * of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, this - * list of conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * Neither the name of the MiG InfoCom AB nor the names of its contributors may be - * used to endorse or promote products derived from this software without specific - * prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * @version 1.0 - * @author Mikael Grev, MiG InfoCom AB - * Date: 2006-sep-08 - */ - -/** A constraint that holds the column <b>or</b> row constraints for the grid. It also holds the gaps between the rows and columns. - * <p> - * This class is a holder and builder for a number of {@link net.miginfocom.layout.DimConstraint}s. - * <p> - * For a more thorough explanation of what these constraints do, and how to build the constraints, see the White Paper or Cheat Sheet at www.migcomponents.com. - * <p> - * Note that there are two way to build this constraint. Through String (e.g. <code>"[100]3[200,fill]"</code> or through API (E.g. - * <code>new AxisConstraint().size("100").gap("3").size("200").fill()</code>. - */ -public final class AC implements Externalizable -{ - private final ArrayList<DimConstraint> cList = new ArrayList<DimConstraint>(8); - - private transient int curIx = 0; - - /** Constructor. Creates an instance that can be configured manually. Will be initialized with a default - * {@link net.miginfocom.layout.DimConstraint}. - */ - public AC() - { - cList.add(new DimConstraint()); - } - - /** Property. The different {@link net.miginfocom.layout.DimConstraint}s that this object consists of. - * These <code><DimConstraints/code> contains all information in this class. - * <p> - * Yes, we are embarrassingly aware that the method is misspelled. - * @return The different {@link net.miginfocom.layout.DimConstraint}s that this object consists of. A new list and - * never <code>null</code>. - */ - public final DimConstraint[] getConstaints() - { - return cList.toArray(new DimConstraint[cList.size()]); - } - - /** Sets the different {@link net.miginfocom.layout.DimConstraint}s that this object should consists of. - * <p> - * Yes, we are embarrassingly aware that the method is misspelled. - * @param constr The different {@link net.miginfocom.layout.DimConstraint}s that this object consists of. The list - * will be copied for storage. <code>null</code> or and emty array will reset the constraints to one <code>DimConstraint</code> - * with default values. - */ - public final void setConstaints(DimConstraint[] constr) - { - if (constr == null || constr.length < 1 ) - constr = new DimConstraint[] {new DimConstraint()}; - - cList.clear(); - cList.ensureCapacity(constr.length); - for (DimConstraint c : constr) - cList.add(c); - } - - /** Returns the number of rows/columns that this constraints currently have. - * @return The number of rows/columns that this constraints currently have. At least 1. - */ - public int getCount() - { - return cList.size(); - } - - /** Sets the total number of rows/columns to <code>size</code>. If the number of rows/columns is already more - * than <code>size</code> nothing will happen. - * @param size The total number of rows/columns - * @return <code>this</code> so it is possible to chain calls. E.g. <code>new AxisConstraint().noGrid().gap().fill()</code>. - */ - public final AC count(int size) - { - makeSize(size); - return this; - } - - /** Specifies that the current row/column should not be grid-like. The while row/colum will have its components layed out - * in one single cell. It is the same as to say that the cells in this column/row will all be merged (a.k.a spanned). - * <p> - * For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com. - * @return <code>this</code> so it is possible to chain calls. E.g. <code>new AxisConstraint().noGrid().gap().fill()</code>. - */ - public final AC noGrid() - { - return noGrid(curIx); - } - - /** Specifies that the indicated rows/columns should not be grid-like. The while row/colum will have its components layed out - * in one single cell. It is the same as to say that the cells in this column/row will all be merged (a.k.a spanned). - * <p> - * For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com. - * @param indexes The index(es) (0-based) of the columns/rows that should be affected by this constraint. - * @return <code>this</code> so it is possible to chain calls. E.g. <code>new AxisConstraint().noGrid().gap().fill()</code>. - */ - public final AC noGrid(int... indexes) - { - for (int i = indexes.length - 1; i >= 0; i--) { - int ix = indexes[i]; - makeSize(ix); - cList.get(ix).setNoGrid(true); - } - return this; - } - - /** Sets the current row/column to <code>i</code>. If the current number of rows/columns is less than <code>i</code> a call - * to {@link #count(int)} will set the size accordingly. - * <p> - * The next call to any of the constraint methods (e.g. {@link net.miginfocom.layout.AC#noGrid}) will be carried - * out on this new row/column. - * <p> - * For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com. - * @param i The new current row/column. - * @return <code>this</code> so it is possible to chain calls. E.g. <code>new AxisConstraint().noGrid().gap().fill()</code>. - */ - public final AC index(int i) - { - makeSize(i); - curIx = i; - return this; - } - - /** Specifies that the current row/column's component should grow by default. It does not affect the size of the row/column. - * <p> - * For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com. - * @return <code>this</code> so it is possible to chain calls. E.g. <code>new AxisConstraint().noGrid().gap().fill()</code>. - */ - public final AC fill() - { - return fill(curIx); - } - - /** Specifies that the indicated rows'/columns' component should grow by default. It does not affect the size of the row/column. - * <p> - * For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com. - * @param indexes The index(es) (0-based) of the columns/rows that should be affected by this constraint. - * @return <code>this</code> so it is possible to chain calls. E.g. <code>new AxisConstraint().noGrid().gap().fill()</code>. - */ - public final AC fill(int... indexes) - { - for (int i = indexes.length - 1; i >= 0; i--) { - int ix = indexes[i]; - makeSize(ix); - cList.get(ix).setFill(true); - } - return this; - } - -// /** Specifies that the current row/column should be put in the end group <code>s</code> and will thus share the same ending -// * coordinate within the group. -// * <p> -// * For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com. -// * @param s A name to associate on the group that should be the same for other rows/columns in the same group. -// * @return <code>this</code> so it is possible to chain calls. E.g. <code>new AxisConstraint().noGrid().gap().fill()</code>. -// */ -// public final AxisConstraint endGroup(String s) -// { -// return endGroup(s, curIx); -// } -// -// /** Specifies that the indicated rows/columns should be put in the end group <code>s</code> and will thus share the same ending -// * coordinate within the group. -// * <p> -// * For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com. -// * @param s A name to associate on the group that should be the same for other rows/columns in the same group. -// * @param indexes The index(es) (0-based) of the columns/rows that should be affected by this constraint. -// * @return <code>this</code> so it is possible to chain calls. E.g. <code>new AxisConstraint().noGrid().gap().fill()</code>. -// */ -// public final AxisConstraint endGroup(String s, int... indexes) -// { -// for (int i = indexes.length - 1; i >= 0; i--) { -// int ix = indexes[i]; -// makeSize(ix); -// cList.get(ix).setEndGroup(s); -// } -// return this; -// } - - /** Specifies that the current row/column should be put in the size group <code>s</code> and will thus share the same size - * constraints as the other components in the group. - * <p> - * Same as <code>sizeGroup("")</code> - * <p> - * For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com. - * @return <code>this</code> so it is possible to chain calls. E.g. <code>new AxisConstraint().noGrid().gap().fill()</code>. - * @since 3.7.2 - */ - public final AC sizeGroup() - { - return sizeGroup("", curIx); - } - - /** Specifies that the current row/column should be put in the size group <code>s</code> and will thus share the same size - * constraints as the other components in the group. - * <p> - * For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com. - * @param s A name to associate on the group that should be the same for other rows/columns in the same group. - * @return <code>this</code> so it is possible to chain calls. E.g. <code>new AxisConstraint().noGrid().gap().fill()</code>. - */ - public final AC sizeGroup(String s) - { - return sizeGroup(s, curIx); - } - - /** Specifies that the indicated rows/columns should be put in the size group <code>s</code> and will thus share the same size - * constraints as the other components in the group. - * <p> - * For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com. - * @param s A name to associate on the group that should be the same for other rows/columns in the same group. - * @param indexes The index(es) (0-based) of the columns/rows that should be affected by this constraint. - * @return <code>this</code> so it is possible to chain calls. E.g. <code>new AxisConstraint().noGrid().gap().fill()</code>. - */ - public final AC sizeGroup(String s, int... indexes) - { - for (int i = indexes.length - 1; i >= 0; i--) { - int ix = indexes[i]; - makeSize(ix); - cList.get(ix).setSizeGroup(s); - } - return this; - } - - /** Specifies the current row/column's min and/or preferred and/or max size. E.g. <code>"10px"</code> or <code>"50:100:200"</code>. - * <p> - * For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com. - * @param s The minimum and/or preferred and/or maximum size of this row. The string will be interpreted - * as a <b>BoundSize</b>. For more info on how <b>BoundSize</b> is formatted see the documentation. - * @return <code>this</code> so it is possible to chain calls. E.g. <code>new AxisConstraint().noGrid().gap().fill()</code>. - */ - public final AC size(String s) - { - return size(s, curIx); - } - - /** Specifies the indicated rows'/columns' min and/or preferred and/or max size. E.g. <code>"10px"</code> or <code>"50:100:200"</code>. - * <p> - * For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com. - * @param size The minimum and/or preferred and/or maximum size of this row. The string will be interpreted - * as a <b>BoundSize</b>. For more info on how <b>BoundSize</b> is formatted see the documentation. - * @param indexes The index(es) (0-based) of the columns/rows that should be affected by this constraint. - * @return <code>this</code> so it is possible to chain calls. E.g. <code>new AxisConstraint().noGrid().gap().fill()</code>. - */ - public final AC size(String size, int... indexes) - { - BoundSize bs = ConstraintParser.parseBoundSize(size, false, true); - for (int i = indexes.length - 1; i >= 0; i--) { - int ix = indexes[i]; - makeSize(ix); - cList.get(ix).setSize(bs); - } - return this; - } - - /** Specifies the gap size to be the default one <b>AND</b> moves to the next column/row. The method is called <code>.gap()</code> - * rather the more natural <code>.next()</code> to indicate that it is very much related to the other <code>.gap(..)</code> methods. - * <p> - * For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com. - * @return <code>this</code> so it is possible to chain calls. E.g. <code>new AxisConstraint().noGrid().gap().fill()</code>. - */ - public final AC gap() - { - curIx++; - return this; - } - - /** Specifies the gap size to <code>size</code> <b>AND</b> moves to the next column/row. - * <p> - * For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com. - * @param size minimum and/or preferred and/or maximum size of the gap between this and the next row/column. - * The string will be interpreted as a <b>BoundSize</b>. For more info on how <b>BoundSize</b> is formatted see the documentation. - * @return <code>this</code> so it is possible to chain calls. E.g. <code>new AxisConstraint().noGrid().gap().fill()</code>. - */ - public final AC gap(String size) - { - return gap(size, curIx++); - } - - /** Specifies the indicated rows'/columns' gap size to <code>size</code>. - * <p> - * For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com. - * @param size minimum and/or preferred and/or maximum size of the gap between this and the next row/column. - * The string will be interpreted as a <b>BoundSize</b>. For more info on how <b>BoundSize</b> is formatted see the documentation. - * @param indexes The index(es) (0-based) of the columns/rows that should be affected by this constraint. - * @return <code>this</code> so it is possible to chain calls. E.g. <code>new AxisConstraint().noGrid().gap().fill()</code>. - */ - public final AC gap(String size, int... indexes) - { - BoundSize bsa = size != null ? ConstraintParser.parseBoundSize(size, true, true) : null; - - for (int i = indexes.length - 1; i >= 0; i--) { - int ix = indexes[i]; - makeSize(ix); - if (bsa != null) - cList.get(ix).setGapAfter(bsa); - } - return this; - } - - /** Specifies the current row/column's columns default alignment <b>for its components</b>. It does not affect the positioning - * or size of the columns/row itself. For columns it is the horizonal alignment (e.g. "left") and for rows it is the vertical - * alignment (e.g. "top"). - * <p> - * For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com. - * @param side The default side to align the components. E.g. "top" or "left", or "leading" or "trailing" or "bottom" or "right". - * @return <code>this</code> so it is possible to chain calls. E.g. <code>new AxisConstraint().noGrid().gap().fill()</code>. - */ - public final AC align(String side) - { - return align(side, curIx); - } - - /** Specifies the indicated rows'/columns' columns default alignment <b>for its components</b>. It does not affect the positioning - * or size of the columns/row itself. For columns it is the horizonal alignment (e.g. "left") and for rows it is the vertical - * alignment (e.g. "top"). - * <p> - * For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com. - * @param side The default side to align the components. E.g. "top" or "left", or "before" or "after" or "bottom" or "right". - * @param indexes The index(es) (0-based) of the columns/rows that should be affected by this constraint. - * @return <code>this</code> so it is possible to chain calls. E.g. <code>new AxisConstraint().noGrid().gap().fill()</code>. - */ - public final AC align(String side, int... indexes) - { - UnitValue al = ConstraintParser.parseAlignKeywords(side, true); - if (al == null) - al = ConstraintParser.parseAlignKeywords(side, false); - - for (int i = indexes.length - 1; i >= 0; i--) { - int ix = indexes[i]; - makeSize(ix); - cList.get(ix).setAlign(al); - } - return this; - } - - /** Specifies the current row/column's grow priority. - * <p> - * For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com. - * @param p The new grow priority. - * @return <code>this</code> so it is possible to chain calls. E.g. <code>new AxisConstraint().noGrid().gap().fill()</code>. - */ - public final AC growPrio(int p) - { - return growPrio(p, curIx); - } - - /** Specifies the indicated rows'/columns' grow priority. - * <p> - * For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com. - * @param p The new grow priority. - * @param indexes The index(es) (0-based) of the columns/rows that should be affected by this constraint. - * @return <code>this</code> so it is possible to chain calls. E.g. <code>new AxisConstraint().noGrid().gap().fill()</code>. - */ - public final AC growPrio(int p, int... indexes) - { - for (int i = indexes.length - 1; i >= 0; i--) { - int ix = indexes[i]; - makeSize(ix); - cList.get(ix).setGrowPriority(p); - } - return this; - } - - /** Specifies the current row/column's grow weight within columns/rows with the <code>grow priority</code> 100f. - * <p> - * Same as <code>grow(100f)</code> - * <p> - * For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com. - * @return <code>this</code> so it is possible to chain calls. E.g. <code>new AxisConstraint().noGrid().gap().fill()</code>. - * @since 3.7.2 - */ - public final AC grow() - { - return grow(1f, curIx); - } - - /** Specifies the current row/column's grow weight within columns/rows with the same <code>grow priority</code>. - * <p> - * For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com. - * @param w The new grow weight. - * @return <code>this</code> so it is possible to chain calls. E.g. <code>new AxisConstraint().noGrid().gap().fill()</code>. - */ - public final AC grow(float w) - { - return grow(w, curIx); - } - - /** Specifies the indicated rows'/columns' grow weight within columns/rows with the same <code>grow priority</code>. - * <p> - * For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com. - * @param w The new grow weight. - * @param indexes The index(es) (0-based) of the columns/rows that should be affected by this constraint. - * @return <code>this</code> so it is possible to chain calls. E.g. <code>new AxisConstraint().noGrid().gap().fill()</code>. - */ - public final AC grow(float w, int... indexes) - { - Float gw = new Float(w); - for (int i = indexes.length - 1; i >= 0; i--) { - int ix = indexes[i]; - makeSize(ix); - cList.get(ix).setGrow(gw); - } - return this; - } - - /** Specifies the current row/column's shrink priority. - * <p> - * For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com. - * @param p The new shrink priority. - * @return <code>this</code> so it is possible to chain calls. E.g. <code>new AxisConstraint().noGrid().gap().fill()</code>. - */ - public final AC shrinkPrio(int p) - { - return shrinkPrio(p, curIx); - } - - /** Specifies the indicated rows'/columns' shrink priority. - * <p> - * For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com. - * @param p The new shrink priority. - * @param indexes The index(es) (0-based) of the columns/rows that should be affected by this constraint. - * @return <code>this</code> so it is possible to chain calls. E.g. <code>new AxisConstraint().noGrid().gap().fill()</code>. - */ - public final AC shrinkPrio(int p, int... indexes) - { - for (int i = indexes.length - 1; i >= 0; i--) { - int ix = indexes[i]; - makeSize(ix); - cList.get(ix).setShrinkPriority(p); - } - return this; - } - - /** Specifies that the current row/column's shrink weight withing the columns/rows with the <code>shrink priority</code> 100f. - * <p> - * Same as <code>shrink(100f)</code>. - * <p> - * For a more thorough explanation of what this constraint does see the White Paper or Cheat Sheet at www.migcomponents.com. - * @return <code>this</code> so it is possible to chain calls. E.g. <code>new AxisConstraint().noGrid().gap().fill()</code>. - * @since 3.7.2 - */ - public final AC shrink() - { - return shrink(100f, curIx); - } - - /** Specifies that the current row/column's shrink weight withing the columns/rows with the same <code>shrink priority</code>. - * <p> - * For a more thorough explanation of what this constraint does see the White Paper or Cheat Sheet at www.migcomponents.com. - * @param w The shrink weight. - * @return <code>this</code> so it is possible to chain calls. E.g. <code>new AxisConstraint().noGrid().gap().fill()</code>. - * @since 3.7.2 - */ - public final AC shrink(float w) - { - return shrink(w, curIx); - } - - /** Specifies the indicated rows'/columns' shrink weight withing the columns/rows with the same <code>shrink priority</code>. - * <p> - * For a more thorough explanation of what this constraint does see the White Paper or Cheat Sheet at www.migcomponents.com. - * @param w The shrink weight. - * @param indexes The index(es) (0-based) of the columns/rows that should be affected by this constraint. - * @return <code>this</code> so it is possible to chain calls. E.g. <code>new AxisConstraint().noGrid().gap().fill()</code>. - * @since 3.7.2 - */ - public final AC shrink(float w, int... indexes) - { - Float sw = new Float(w); - for (int i = indexes.length - 1; i >= 0; i--) { - int ix = indexes[i]; - makeSize(ix); - cList.get(ix).setShrink(sw); - } - return this; - } - - /** Specifies that the current row/column's shrink weight withing the columns/rows with the same <code>shrink priority</code>. - * <p> - * For a more thorough explanation of what this constraint does see the White Paper or Cheat Sheet at www.migcomponents.com. - * @param w The shrink weight. - * @return <code>this</code> so it is possible to chain calls. E.g. <code>new AxisConstraint().noGrid().gap().fill()</code>. - * @deprecated in 3.7.2. Use {@link #shrink(float)} instead. - */ - public final AC shrinkWeight(float w) - { - return shrink(w); - } - - /** Specifies the indicated rows'/columns' shrink weight withing the columns/rows with the same <code>shrink priority</code>. - * <p> - * For a more thorough explanation of what this constraint does see the White Paper or Cheat Sheet at www.migcomponents.com. - * @param w The shrink weight. - * @param indexes The index(es) (0-based) of the columns/rows that should be affected by this constraint. - * @return <code>this</code> so it is possible to chain calls. E.g. <code>new AxisConstraint().noGrid().gap().fill()</code>. - * @deprecated in 3.7.2. Use {@link #shrink(float, int...)} instead. - */ - public final AC shrinkWeight(float w, int... indexes) - { - return shrink(w, indexes); - } - - private void makeSize(int sz) - { - if (cList.size() <= sz) { - cList.ensureCapacity(sz); - for (int i = cList.size(); i <= sz; i++) - cList.add(new DimConstraint()); - } - } - - // ************************************************ - // Persistence Delegate and Serializable combined. - // ************************************************ - - private Object readResolve() throws ObjectStreamException - { - return LayoutUtil.getSerializedObject(this); - } - - public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException - { - LayoutUtil.setSerializedObject(this, LayoutUtil.readAsXML(in)); - } - - public void writeExternal(ObjectOutput out) throws IOException - { - if (getClass() == AC.class) - LayoutUtil.writeAsXML(out, this); - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/marmotta/blob/60ae655a/launchers/marmotta-splash/src/ext/java/net/miginfocom/layout/BoundSize.java ---------------------------------------------------------------------- diff --git a/launchers/marmotta-splash/src/ext/java/net/miginfocom/layout/BoundSize.java b/launchers/marmotta-splash/src/ext/java/net/miginfocom/layout/BoundSize.java deleted file mode 100644 index 924a644..0000000 --- a/launchers/marmotta-splash/src/ext/java/net/miginfocom/layout/BoundSize.java +++ /dev/null @@ -1,273 +0,0 @@ -package net.miginfocom.layout; - -import java.beans.Encoder; -import java.beans.Expression; -import java.beans.PersistenceDelegate; -import java.io.*; -/* - * License (BSD): - * ============== - * - * Copyright (c) 2004, Mikael Grev, MiG InfoCom AB. (miglayout (at) miginfocom (dot) com) - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright notice, this list - * of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, this - * list of conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * Neither the name of the MiG InfoCom AB nor the names of its contributors may be - * used to endorse or promote products derived from this software without specific - * prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * @version 1.0 - * @author Mikael Grev, MiG InfoCom AB - * Date: 2006-sep-08 - */ - -/** A size that contains minimum, preferred and maximum size of type {@link UnitValue}. - * <p> - * This class is a simple value container and it is immutable. - * <p> - * If a size is missing (i.e., <code>null</code>) that boundary should be considered "not in use". - * <p> - * You can create a BoundSize from a String with the use of {@link ConstraintParser#parseBoundSize(String, boolean, boolean)} - */ -public class BoundSize implements Serializable -{ - public static final BoundSize NULL_SIZE = new BoundSize(null, null); - public static final BoundSize ZERO_PIXEL = new BoundSize(UnitValue.ZERO, "0px"); - - private final transient UnitValue min; - private final transient UnitValue pref; - private final transient UnitValue max; - private final transient boolean gapPush; - - /** Constructor that use the same value for min/preferred/max size. - * @param minMaxPref The value to use for min/preferred/max size. - * @param createString The string used to create the BoundsSize. - */ - public BoundSize(UnitValue minMaxPref, String createString) - { - this(minMaxPref, minMaxPref, minMaxPref, createString); - } - - /** Constructor. <b>This method is here for serilization only and should normally not be used. Use - * {@link ConstraintParser#parseBoundSize(String, boolean, boolean)} instead. - * @param min The minimum size. May be <code>null</code>. - * @param preferred The preferred size. May be <code>null</code>. - * @param max The maximum size. May be <code>null</code>. - * @param createString The string used to create the BoundsSize. - */ - public BoundSize(UnitValue min, UnitValue preferred, UnitValue max, String createString) // Bound to old delegate!!!!! - { - this(min, preferred, max, false, createString); - } - - /** Constructor. <b>This method is here for serilization only and should normally not be used. Use - * {@link ConstraintParser#parseBoundSize(String, boolean, boolean)} instead. - * @param min The minimum size. May be <code>null</code>. - * @param preferred The preferred size. May be <code>null</code>. - * @param max The maximum size. May be <code>null</code>. - * @param gapPush If the size should be hinted as "pushing" and thus want to occupy free space if no one else is claiming it. - * @param createString The string used to create the BoundsSize. - */ - public BoundSize(UnitValue min, UnitValue preferred, UnitValue max, boolean gapPush, String createString) - { - this.min = min; - this.pref = preferred; - this.max = max; - this.gapPush = gapPush; - - LayoutUtil.putCCString(this, createString); // this escapes!! - } - - /** Returns the minimum size as sent into the constructor. - * @return The minimum size as sent into the constructor. May be <code>null</code>. - */ - public final UnitValue getMin() - { - return min; - } - - /** Returns the preferred size as sent into the constructor. - * @return The preferred size as sent into the constructor. May be <code>null</code>. - */ - public final UnitValue getPreferred() - { - return pref; - } - - /** Returns the maximum size as sent into the constructor. - * @return The maximum size as sent into the constructor. May be <code>null</code>. - */ - public final UnitValue getMax() - { - return max; - } - - /** If the size should be hinted as "pushing" and thus want to occupy free space if noone else is claiming it. - * @return The value. - */ - public boolean getGapPush() - { - return gapPush; - } - - /** Returns if this bound size has no min, preferred and maximum size set (they are all <code>null</code>) - * @return If unset. - */ - public boolean isUnset() - { - // Most common case by far is this == ZERO_PIXEL... - return this == ZERO_PIXEL || (pref == null && min == null && max == null && gapPush == false); - } - - /** Makes sure that <code>size</code> is within min and max of this size. - * @param size The size to constrain. - * @param refValue The reference to use for relative sizes. - * @param parent The parent container. - * @return The size, constrained within min and max. - */ - public int constrain(int size, float refValue, ContainerWrapper parent) - { - if (max != null) - size = Math.min(size, max.getPixels(refValue, parent, parent)); - if (min != null) - size = Math.max(size, min.getPixels(refValue, parent, parent)); - return size; - } - - /** Returns the minimum, preferred or maximum size for this bounded size. - * @param sizeType The type. <code>LayoutUtil.MIN</code>, <code>LayoutUtil.PREF</code> or <code>LayoutUtil.MAX</code>. - * @return - */ - final UnitValue getSize(int sizeType) - { - switch(sizeType) { - case LayoutUtil.MIN: - return min; - case LayoutUtil.PREF: - return pref; - case LayoutUtil.MAX: - return max; - default: - throw new IllegalArgumentException("Unknown size: " + sizeType); - } - } - - /** Convert the bound sizes to pixels. - * <p> - * <code>null</code> bound sizes will be 0 for min and preferred and {@link net.miginfocom.layout.LayoutUtil#INF} for max. - * @param refSize The reference size. - * @param parent The parent. Not <code>null</code>. - * @param comp The component, if applicable, can be <code>null</code>. - * @return An array of lenth three (min,pref,max). - */ - final int[] getPixelSizes(float refSize, ContainerWrapper parent, ComponentWrapper comp) - { - return new int[] { - min != null ? min.getPixels(refSize, parent, comp) : 0, - pref != null ? pref.getPixels(refSize, parent, comp) : 0, - max != null ? max.getPixels(refSize, parent, comp) : LayoutUtil.INF - }; - } - - /** Returns the a constraint string that can be re-parsed to be the exact same UnitValue. - * @return A String. Never <code>null</code>. - */ - String getConstraintString() - { - String cs = LayoutUtil.getCCString(this); - if (cs != null) - return cs; - - if (min == pref && pref == max) - return min != null ? (min.getConstraintString() + "!") : "null"; - - StringBuilder sb = new StringBuilder(16); - - if (min != null) - sb.append(min.getConstraintString()).append(':'); - - if (pref != null) { - if (min == null && max != null) - sb.append(":"); - sb.append(pref.getConstraintString()); - } else if (min != null) { - sb.append('n'); - } - - if (max != null) - sb.append(sb.length() == 0 ? "::" : ":").append(max.getConstraintString()); - - if (gapPush) { - if (sb.length() > 0) - sb.append(':'); - sb.append("push"); - } - - return sb.toString(); - } - - void checkNotLinked() - { - if (min != null && min.isLinkedDeep() || pref != null && pref.isLinkedDeep() || max != null && max.isLinkedDeep()) - throw new IllegalArgumentException("Size may not contain links"); - } - - static { - if(LayoutUtil.HAS_BEANS){ - LayoutUtil.setDelegate(BoundSize.class, new PersistenceDelegate() { - protected Expression instantiate(Object oldInstance, Encoder out) - { - BoundSize bs = (BoundSize) oldInstance; - if (Grid.TEST_GAPS) { - return new Expression(oldInstance, BoundSize.class, "new", new Object[] { - bs.getMin(), bs.getPreferred(), bs.getMax(), bs.getGapPush(), bs.getConstraintString() - }); - } else { - return new Expression(oldInstance, BoundSize.class, "new", new Object[] { - bs.getMin(), bs.getPreferred(), bs.getMax(), bs.getConstraintString() - }); - } - } - }); - } - } - - // ************************************************ - // Persistence Delegate and Serializable combined. - // ************************************************ - - private static final long serialVersionUID = 1L; - - protected Object readResolve() throws ObjectStreamException - { - return LayoutUtil.getSerializedObject(this); - } - - private void writeObject(ObjectOutputStream out) throws IOException - { - if (getClass() == BoundSize.class) - LayoutUtil.writeAsXML(out, this); - } - - private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException - { - LayoutUtil.setSerializedObject(this, LayoutUtil.readAsXML(in)); - } -}
