📄 titledtabstateproperties.java
字号:
/*
* Copyright (C) 2004 NNL Technology AB
* Visit www.infonode.net for information about InfoNode(R)
* products and how to contact NNL Technology AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston,
* MA 02111-1307, USA.
*/
// $Id: TitledTabStateProperties.java,v 1.24 2005/02/16 11:28:15 jesper Exp $
package net.infonode.tabbedpanel.titledtab;
import net.infonode.properties.gui.util.ComponentProperties;
import net.infonode.properties.gui.util.ShapedPanelProperties;
import net.infonode.properties.propertymap.*;
import net.infonode.properties.types.*;
import net.infonode.util.Alignment;
import net.infonode.util.Direction;
import javax.swing.*;
/**
* TitledTabStateProperties holds all properties that are unique for a titled tab state.
*
* @author $Author: jesper $
* @version $Revision: 1.24 $
* @see TitledTab
* @see TitledTabProperties
*/
public class TitledTabStateProperties extends PropertyMapContainer {
/**
* A property group for all properties in TitledTabStateProperties
*/
public static final PropertyMapGroup PROPERTIES = new PropertyMapGroup("State Properties", "");
/**
* Icon property
*
* @see #setIcon
* @see #getIcon
*/
public static final IconProperty ICON = new IconProperty(PROPERTIES,
"Icon",
"Icon",
PropertyMapValueHandler.INSTANCE);
/**
* Text property
*
* @see #setText
* @see #getText
*/
public static final StringProperty TEXT = new StringProperty(PROPERTIES,
"Text",
"Text",
PropertyMapValueHandler.INSTANCE);
/**
* Icon text gap property
*
* @see #setIconTextGap
* @see #getIconTextGap
*/
public static final IntegerProperty ICON_TEXT_GAP = IntegerProperty.createPositive(PROPERTIES,
"Icon Text Gap",
"Number of pixels between icon and text.",
2,
PropertyMapValueHandler.INSTANCE);
/**
* Tool tip text property
*
* @see #setToolTipText
* @see #getToolTipText
*/
public static final StringProperty TOOL_TIP_TEXT = new StringProperty(PROPERTIES,
"Tool Tip Text",
"Tool tip text",
PropertyMapValueHandler.INSTANCE);
/**
* Tool tip enabled property
*
* @see #setToolTipEnabled
* @see #getToolTipEnabled
*/
public static final BooleanProperty TOOL_TIP_ENABLED = new BooleanProperty(PROPERTIES,
"Tool Tip Enabled",
"Tool tip enabled or disabled",
PropertyMapValueHandler.INSTANCE);
/**
* Icon visible property
*
* @see #setIconVisible
* @see #getIconVisible
* @since ITP 1.1.0
*/
public static final BooleanProperty ICON_VISIBLE = new BooleanProperty(PROPERTIES,
"Icon Visible",
"Icon visible or not visible",
PropertyMapValueHandler.INSTANCE);
/**
* Text visible property
*
* @see #setTextVisible
* @see #getTextVisible
* @since ITP 1.1.0
*/
public static final BooleanProperty TEXT_VISIBLE = new BooleanProperty(PROPERTIES,
"Text Visible",
"Text visible or not visible",
PropertyMapValueHandler.INSTANCE);
/**
* Title component visible property
*
* @see #setTitleComponentVisible
* @see #getTitleComponentVisible
* @since ITP 1.1.0
*/
public static final BooleanProperty TITLE_COMPONENT_VISIBLE = new BooleanProperty(PROPERTIES,
"Title Component Visible",
"Title component visible or not visible",
PropertyMapValueHandler.INSTANCE);
/**
* Horizontal alignment property
*
* @see #setHorizontalAlignment
* @see #getHorizontalAlignment
*/
public static final AlignmentProperty HORIZONTAL_ALIGNMENT = new AlignmentProperty(PROPERTIES,
"Horizontal Alignment",
"Horizontal alignment for the icon and text.",
PropertyMapValueHandler.INSTANCE,
Alignment.getHorizontalAlignments());
/**
* Vertical alignment property
*
* @see #setVerticalAlignment
* @see #getVerticalAlignment
*/
public static final AlignmentProperty VERTICAL_ALIGNMENT = new AlignmentProperty(PROPERTIES,
"Vertical Alignment",
"Vertical alignment for the icon and text.",
PropertyMapValueHandler.INSTANCE,
Alignment.getVerticalAlignments());
/**
* Icon text relative alignment property
*
* @see #setIconTextRelativeAlignment
* @see #getIconTextRelativeAlignment
*/
public static final AlignmentProperty ICON_TEXT_RELATIVE_ALIGNMENT = new AlignmentProperty(PROPERTIES,
"Icon Text Relative Alignment",
"Icon horizontal alignment relative to text.",
PropertyMapValueHandler.INSTANCE,
new Alignment[]{
Alignment.LEFT,
Alignment.RIGHT});
/**
* Text title component gap property
*
* @see #setTextTitleComponentGap
* @see #getTextTitleComponentGap
*/
public static final IntegerProperty TEXT_TITLE_COMPONENT_GAP = IntegerProperty.createPositive(PROPERTIES,
"Text Title Component Gap",
"Number of pixels between text and title component.",
2,
PropertyMapValueHandler.INSTANCE);
/**
* Title component text relative alignment property
*
* @see #setTitleComponentTextRelativeAlignment
* @see #getTitleComponentTextRelativeAlignment
*/
public static final AlignmentProperty TITLE_COMPONENT_TEXT_RELATIVE_ALIGNMENT = new AlignmentProperty(PROPERTIES,
"Title Component Text Relative Alignment",
"Title component horizontal alignment relative to text and icon.",
PropertyMapValueHandler.INSTANCE,
new Alignment[]{
Alignment.LEFT,
Alignment.RIGHT});
/**
* Direction property
*
* @see #setDirection
* @see #getDirection
*/
public static final DirectionProperty DIRECTION = new DirectionProperty(PROPERTIES,
"Direction",
"Direction for tab contents",
PropertyMapValueHandler.INSTANCE);
/**
* Tab component properties.
*/
public static final PropertyMapProperty COMPONENT_PROPERTIES = new PropertyMapProperty(PROPERTIES,
"Component Properties",
"Tab component properties.",
ComponentProperties.PROPERTIES);
/**
* Tab shaped panel properties.
*
* @since ITP 1.2.0
*/
public static final PropertyMapProperty SHAPED_PANEL_PROPERTIES = new PropertyMapProperty(PROPERTIES,
"Shaped Panel Properties",
"Tab shaped panel properties.",
ShapedPanelProperties.PROPERTIES);
/**
* Constructs an empty TitledTabStateProperties object
*/
public TitledTabStateProperties() {
super(PROPERTIES);
}
/**
* Constructs a TitledTabStateProperties map with the give map as property storage
*
* @param map map to store properties in
*/
public TitledTabStateProperties(PropertyMap map) {
super(map);
}
/**
* Constructs a TitledTabStateProperties object that inherits its properties from the given TitledTabStateProperties object
*
* @param inheritFrom TitledTabStateProperties object to inherit properties from
*/
public TitledTabStateProperties(TitledTabStateProperties inheritFrom) {
super(PropertyMapFactory.create(inheritFrom.getMap()));
}
/**
* Adds a super object from which property values are inherited.
*
* @param superObject the object from which to inherit property values
* @return this
*/
public TitledTabStateProperties addSuperObject(TitledTabStateProperties superObject) {
getMap().addSuperMap(superObject.getMap());
return this;
}
/**
* Removes the last added super object.
*
* @return this
*/
public TitledTabStateProperties removeSuperObject() {
getMap().removeSuperMap();
return this;
}
/**
* Removes the given super object.
*
* @param superObject super object to remove
* @return this
* @since ITP 1.3.0
*/
public TitledTabStateProperties removeSuperObject(TitledTabStateProperties superObject) {
getMap().removeSuperMap(superObject.getMap());
return this;
}
/**
* Sets the icon
*
* @param icon icon or null for no icon
* @return this TitledTabStateProperties
*/
public TitledTabStateProperties setIcon(Icon icon) {
ICON.set(getMap(), icon);
return this;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -