|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Objectnet.mariottini.layout.PileLayout
public final class PileLayout
A layout manager that piles components either vertically or horizontally. Components are layed out with their preferred with and height, aligned or resized according to the constraints used. See the document "How to use PileLayout" for more information.
Copyright © 2006, 2007 Roberto Mariottini. All rights reserved.
Permission is granted to anyone to use this software in source and binary forms
for any purpose, with or without modification, including commercial applications,
and to alter it and redistribute it freely, provided that the following conditions
are met:
o Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
o The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
o Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
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.
| Field Summary | |
|---|---|
static Integer |
ALIGN_BOTTOM
the component is vertically aligned to the bottom (valid ony for horizontal placement) |
static Integer |
ALIGN_CENTER
the component is horizontally center aligned (valid ony for vertical placement) |
static Integer |
ALIGN_EXPAND
like ALIGN_FIT but expands in both dimensions |
static Integer |
ALIGN_FIT
the component is not aligned, but fitted in size (adjusting its height for horizontal placement or its width for vertical placement) |
static Integer |
ALIGN_LEFT
the component is horizontally aligned to the left (valid ony for vertical placement) |
static Integer |
ALIGN_MIDDLE
the component is vertically aligned to the middle (valid ony for horizontal placement) |
static Integer |
ALIGN_RIGHT
the component is horizontally aligned to the right (valid ony for vertical placement) |
static Integer |
ALIGN_TOP
the component is vertically aligned to the top (valid ony for horizontal placement) |
static int |
DIRECTION_HORIZONTAL
the placement direction is horizontal |
static int |
DIRECTION_VERTICAL
the placement direction is vertical |
| Constructor Summary | |
|---|---|
PileLayout(int direction)
Builds a PileLayout with the specified placement direction, with the default gap and with the default margins. |
|
PileLayout(int direction,
Insets margins)
Builds a PileLayout with the specified placement direction, with the default gap and with the specified margins. |
|
PileLayout(int direction,
int gap)
Builds a PileLayout with the specified placement direction and with the specified gap, used also for the margins. |
|
PileLayout(int direction,
int gap,
Insets margins)
Builds a PileLayout with the specified placement direction, with the specified gap and with the specified margins. |
|
| Method Summary | |
|---|---|
void |
addLayoutComponent(Component comp,
Object constr)
|
void |
addLayoutComponent(String x,
Component comp)
|
float |
getLayoutAlignmentX(Container target)
|
float |
getLayoutAlignmentY(Container target)
|
void |
invalidateLayout(Container target)
|
void |
layoutContainer(Container cont)
|
Dimension |
maximumLayoutSize(Container target)
|
Dimension |
minimumLayoutSize(Container cont)
|
Dimension |
preferredLayoutSize(Container cont)
|
void |
removeLayoutComponent(Component comp)
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final Integer ALIGN_LEFT
public static final Integer ALIGN_CENTER
public static final Integer ALIGN_RIGHT
public static final Integer ALIGN_TOP
public static final Integer ALIGN_MIDDLE
public static final Integer ALIGN_BOTTOM
public static final Integer ALIGN_FIT
public static final Integer ALIGN_EXPAND
ALIGN_FIT but expands in both dimensions
public static final int DIRECTION_HORIZONTAL
public static final int DIRECTION_VERTICAL
| Constructor Detail |
|---|
public PileLayout(int direction)
direction - one of DIRECTION_HORIZONTAL or DIRECTION_VERTICAL
public PileLayout(int direction,
int gap)
direction - one of DIRECTION_HORIZONTAL or DIRECTION_VERTICALgap - the gap used for component spacing and also for margins
public PileLayout(int direction,
Insets margins)
direction - one of DIRECTION_HORIZONTAL or DIRECTION_VERTICALmargins - the margins to use
public PileLayout(int direction,
int gap,
Insets margins)
direction - one of DIRECTION_HORIZONTAL or DIRECTION_VERTICALgap - the gap used for component spacingmargins - the margins to use| Method Detail |
|---|
public void addLayoutComponent(String x,
Component comp)
addLayoutComponent in interface LayoutManagerpublic void removeLayoutComponent(Component comp)
removeLayoutComponent in interface LayoutManagerpublic Dimension preferredLayoutSize(Container cont)
preferredLayoutSize in interface LayoutManagerpublic Dimension minimumLayoutSize(Container cont)
minimumLayoutSize in interface LayoutManagerpublic void layoutContainer(Container cont)
layoutContainer in interface LayoutManager
public void addLayoutComponent(Component comp,
Object constr)
addLayoutComponent in interface LayoutManager2public float getLayoutAlignmentX(Container target)
getLayoutAlignmentX in interface LayoutManager2public float getLayoutAlignmentY(Container target)
getLayoutAlignmentY in interface LayoutManager2public void invalidateLayout(Container target)
invalidateLayout in interface LayoutManager2public Dimension maximumLayoutSize(Container target)
maximumLayoutSize in interface LayoutManager2
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||