package org.aswing

border
colorchooser
dnd
error
event
ext
geom
graphics
plaf
resizer
table
tree
util
ASColor

ASColor object to set color and alpha.

ASFont

Font that specified the font name, size, style and whether or not embed.

ASFontAdvProperties

The advanced properties for font.

AWKeyboard

AWSprite

Dispatched when the mouse released or released out side. If you need a event like AS2 onRelease you can use Event.CLICK

AWTextField

Dispatched when the text changed, programmatic change or user change.

AbstractButton

Defines common behaviors for buttons and menu items.

AbstractCellEditor

Authors

  • paling

AbstractListCell

Abstract list cell.

AbstractListModel

Abstract list model that provide the list model events base.

AbstractTabbedPane

An abstract class for all Container pane class that have title, icon, tip for every sub pane.

AsWingConstants

A collection of constants generally used for positioning and orienting components on the screen.

AsWingManager

The main manager for AsWing framework.

You may need to call setRoot() to set a default root container for AsWing Popups.

AsWingUtils

A collection of utility methods for AsWing.

AssetBackground

A background with specified asset display object.

AssetIcon

Abstract class for A icon with a decorative displayObject.

AssetItem

AssetItem is a holder for asset properties.

AssetPane

Abstract class for A container with a decorative asset.

Border

Interface describing an object capable of rendering a border around the edges of a component.

You can either return a display object to be the border or just return null and paint the border in updateBorder method use the component g(Graphics).

BorderLayout

A border layout lays out a container, arranging and resizing its components to fit in five regions: north, south, east, west, and center. Each region may contain no more than one component, and is identified by a corresponding constant: NORTH, SOUTH, EAST, WEST, and CENTER. When adding a component to a container with a border layout, use one of these five constants, for example:

var p: JPanel = new JPanel();
p.setLayout(new BorderLayout());
p.append(new JButton("Ok"), BorderLayout.SOUTH);
For convenience, BorderLayout interprets the absence of a string specification the same as the constant CENTER:
var p2: JPanel = new JPanel();
p2.setLayout(new BorderLayout());
p2.append(new TextArea());  // Same as p.add(new TextArea(), BorderLayout.CENTER);

BoundedRangeModel

Defines the data model used by components like Sliders and ProgressBars. Defines four interrelated integer properties: minimum, maximum, extent and value. These four integers define two nested ranges like this:

minimum <= value <= value+extent <= maximum
The outer range is minimum,maximum and the inner range is value,value+extent. The inner range must lie within the outer one, i.e. value must be less than or equal to maximum and value+extent must greater than or equal to minimum, and maximum must be greater than or equal to minimum. There are a few features of this model that one might find a little surprising. These quirks exist for the convenience of the Swing BoundedRangeModel clients, such as Slider and ScrollBar.
  • The minimum and maximum set methods "correct" the other three properties to accommodate their new value argument. For example setting the model's minimum may change its maximum, value, and extent properties (in that order), to maintain the constraints specified above.
  • The value and extent set methods "correct" their argument to fit within the limits defined by the other three properties.
    For example if value == maximum, setExtent(10) would change the extent (back) to zero.
  • The four BoundedRangeModel values are defined as Java Beans style properties.

Only setValue and setRangeProperties can indicate programmatic property, other set methods all will always go with programmatic=true except setValueIsAdjusting.

Box

A JPanel with BoxLayout.

BoxLayout

A layout manager that allows multiple components to be arranged either vertically or horizontally. The components will not be wrapped. The width, height, preferredWidth, preferredHeight doesn't affect the way this layout manager layout the components.

ButtonGroup

This class is used to create a multiple-exclusion scope for a set of buttons. Creating a set of buttons with the same ButtonGroup object means that turning "on" one of those buttons turns off all other buttons in the group.

A ButtonGroup can be used with any set of objects that inherit from AbstractButton. Typically a button group contains instances of JRadioButton, JRadioButtonMenuItem, or JToggleButton. It wouldn't make sense to put an instance of JButton or JMenuItem in a button group because JButton and JMenuItem don't implement the selected state.

ButtonModel

State Model for buttons. This model is used for check boxes and radio buttons, which are special kinds of buttons, as well as for normal buttons. For check boxes and radio buttons, pressing the mouse selects the button. For normal buttons, pressing the mouse "arms" the button. Releasing the mouse over the button then initiates a button press, firing its action event. Releasing the mouse elsewhere disarms the button.

In use, a UI will invoke setSelected when a mouse click occurs over a check box or radio button. It will invoke setArmed</code when the mouse is pressed over a regular button and invoke setPressed</code when the mouse is released. If the mouse travels outside the button in the meantime, setArmed(false) will tell the button not to fire when it sees setPressed. (If the mouse travels back in, the button will be rearmed.)

Cell

Complex component cell base class, like JList, JTable's cell.

CellEditor

This interface defines the methods any general editor should be able to implement.

Having this interface enables complex components (the client of the editor) such as JList, JTree, and JTable to allow any generic editor to edit values in a table cell, or tree cell, etc. Without this generic editor interface, JTable would have to know about specific editors, such as JTextField, JCheckBox, JComboBox, etc. In addition, without this interface, clients of editors such as JTable would not be able to work with any editors developed in the future by the user or a 3rd party ISV.

CellPane

Cell Pane is just a container, it do not layout children, do not invalidate parent.

CenterLayout

Simple LayoutManager aligned the single contained component by the container's center.

ComboBoxEditor

The editor component used for JComboBox components.

Component

The super class for all Components.

Container

Container can contain many component to be his child, all children are in its bounds, and it moved, all children moved. It be removed from stage all children will be removed from stage.

It for component like DisplayObjectContainer for DisplayObject.

ContainerOrderFocusTraversalPolicy

A FocusTraversalPolicy that determines traversal order based on the order of child Components in a Container.

Cursor

The Cursor definited from Look and Feels.

CursorManager

The CursorManager, manage the cursor, hide system mouse cursor, show custom cursor, etc.

Decorator

Decorator for components, it return a display object to be the UI decorator.

DefaultBoundedRangeModel

The default implementation of BoundedRangeModel.

DefaultButtonModel

The default implementation of a Button component's data model.

DefaultCheckBoxCellEditor

Authors

  • paling

DefaultComboBoxCellEditor

The default editor for table and tree cells, use a combobox.

DefaultComboBoxEditor

DefaultComboBoxListCell

The list cell for combobox drop down list.

DefaultComboBoxListCellFactory

The default list cell factory for JComboBox drop down list.

DefaultListCell

Default list cell, render item value.toString() text.

DefaultListCellFactory

The default list cell factory for JList.

DefaultListSelectionModel

Default data model for list selections.

DefaultListTextCellFactory

The default list cell factory for text cells.

DefaultNumberTextFieldCellEditor

Authors

  • paling

DefaultSingleSelectionModel

A generic implementation of SingleSelectionModel.

DefaultTextFieldCellEditor

The default editor for table and tree cells, use a textfield.

EditableComponent

Interface for editable components.

EmptyFont

EmptyFont is a font that will not change text field's format.

EmptyIcon

EmptyIcon is just for sit a place.

EmptyLayout

LayoutManager's empty implementation.

FlowLayout

A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. Flow layouts are typically used to arrange buttons in a panel. It will arrange buttons left to right until no more buttons fit on the same line. Each line is centered.

FlowWrapLayout

FlowWrapLayout wrap layout is extended FlowLayout, the only different is that it has a preferred width, it means that when count the preffered size, it assume to let chilren arrange to a line when one reach the preferred width, then wrap to next line. FlowLayout is different, when counting the preferred size, FlowLayout assumes all children should be arrange to one line.

FocusManager

FocusManager manages all the when a component should receive focus, i.e if it can.

FocusTraversalPolicy

A FocusTraversalPolicy defines the order in which Components with a particular focus cycle root are traversed in a Container.

The core responsibility of a FocusTraversalPolicy is to provide algorithms determining the next and previous Components to focus when traversing forward or backward in a UI. Each FocusTraversalPolicy must also provide algorithms for determining the default Components in a traversal cycle. The default Component is the first to receive focus when traversing down into a new focus traversal cycle. if the next/previous searched null to be returned, it means can't found a component to be focused.

FrameTitleBar

FrameTitleBarLayout

GeneralListCellFactory

GeneralListCellFactory let you can just specified a ListCell implemented class and other params to create a ListCellFactory

GradientBackground

A background decorator that paint a gradient color. @author

GridLayout

A grid layout with the specified number of rows and columns. All components in the layout are given equal size.

GroundDecorator

Decorator for background or foreground of a components.

You can either return a display object to be the decorator or just return null and paint
in updateDecorator method use the component g(Graphics).

(Maybe it is not good to paint on the component graphics for foreground decorator since component graphics is not on top of component children)

Icon

A small fixed size picture, typically used to decorate components.

You can either return a display object to be the icon or just return null and paint the picture in updateIcon method use the component g(Graphics).

Insets
JAccordion

Accordion Container.

JAdjuster

A component that combine a input text and a button to drop-down a popup slider to let user input/select a value.

JButton

An implementation of a "push" button.

JCheckBox

An implementation of a check box -- an item that can be selected or deselected, and which displays its state to the user. By convention, any number of check boxes in a group can be selected.

JCheckBoxMenuItem

A menu item that can be selected or deselected. If selected, the menu item typically appears with a checkmark next to it. If unselected or deselected, the menu item appears without a checkmark. Like a regular menu item, a check box menu item can have either text or a graphic icon associated with it, or both.

JClosableTabbedPane

A JTabbedPane where a each tab has a close button, you must listen the TabCloseEvent and then remove the related tab component if you want.

JColorChooser

JColorChooser provides a pane of controls designed to allow a user to manipulate and select a color.

JComboBox

A component that combines a button or editable field and a drop-down list. The user can select a value from the drop-down list, which appears at the user's request. If you make the combo box editable, then the combo box includes an editable field into which the user can type a value.

JComboBox use a JList to be the drop-down list, so of course you can operate list to do some thing.

JFrame

JFrame is a window with title and maximized/iconified/normal state, and resizer.

JFrameTitleBar

The default Imp of FrameTitleBar

JLabel

A display area for a short text string or an image, or both.

JLabelButton

A button that looks like a hypertext link.

JLayeredPane

JList

A component that allows the user to select one or more objects from a list. A separate model, ListModel, represents the contents of the list. It's easy to display an array objects, using a JList constructor that builds a ListModel instance for you:

// Create a JList that displays the strings in data[]

JLoadPane

JLoadPane, a container load a external image/animation to be its asset.

JMenu

An implementation of a menu -- a popup window containing JMenuItems that is displayed when the user selects an item on the JMenuBar. In addition to JMenuItems, a JMenu can also contain JSeparators.

JMenuBar

An implementation of a menu bar. You add JMenu objects to the menu bar to construct a menu. When the user selects a JMenu object, its associated JPopupMenu is displayed, allowing the user to select one of the JMenuItem on it.

JMenuItem

An implementation of an item in a menu. A menu item is essentially a button sitting in a list. When the user selects the "button", the action associated with the menu item is performed. A JMenuItem contained in a JPopupMenu performs exactly that function.

JOptionPane

JOptionPane makes it easy to pop up a standard dialog box that prompts users for a value or informs them of something.

There's some shortcut to do there with static methods like showMessageDialog, showInputDialog. But if you want to make a hole control of JOptionPane, you can create a JOptionPane by yourself and append it into a your JFrame.

JPanel

The general container - a panel.

JPopup

JPopup is a component that generally be a base container of a window panel.

JPopupMenu

An implementation of a popup menu -- a small window that pops up and displays a series of choices.

JProgressBar

A component that, by default, displays an integer value within a bounded interval.

JRadioButton

An implementation of a radio button -- an item that can be selected or deselected, and which displays its state to the user. Used with a ButtonGroup object to create a group of buttons in which only one button at a time can be selected. (Create a ButtonGroup object and use its Component.append method to include the JRadioButton objects in the group.)

Note: The ButtonGroup object is a logical grouping -- not a physical grouping. To create a button panel, you should still create a JPanel or similar container-object and add a org.aswing.border.Border to it to set it off from surrounding components.

JRadioButtonMenuItem

An implementation of a radio button menu item. A JRadioButtonMenuItem is a menu item that is part of a group of menu items in which only one item in the group can be selected. The selected item displays its selected state. Selecting it causes any other selected item to switch to the unselected state.

JRootPane

The general AsWing window root container, it is the popup, window and frame's ancestor.

JScrollBar

An implementation of a scrollbar.

JScrollPane

JScrollPane is a container with two scrollbar controllin the viewport's beeing viewed area.

If you want to change the unit or block increment of the scrollbars in a scrollpane, you shoud controll it with viewport instead of scrollbar directly, because the scrollbar's increment will be set to same to viewport's always. I mean use JViewport.horizontalUnitIncrement instead of JScrollBar.unitIncrement

JSeparator

JSeparator provides a general purpose component for implementing divider lines - most commonly used as a divider between menu items that breaks them up into logical groupings.

JSharedToolTip

Shared instance of JTooltip to saving instances.

JSlider

A component that lets the user graphically select a value by sliding a knob within a bounded interval. The slider can show both major tick marks and minor tick marks between them. The number of values between the tick marks is controlled with this.majorTickSpacing and this.minorTickSpacing.

JSpacer

JSpacer provides basic functionality to create empty spaces between other components.

JSplitPane

JSplitPane is used to divide two (and only two) Components. The two Components are graphically divided based on the look and feel implementation, and the two Components can then be interactively resized by the user.

JStepper

A component that combine a input text and two arrow button to let user change a number value step by step.

JTabbedPane

A component that lets the user switch between a group of components by clicking on a tab with a given title and/or icon.

Tabs/components are added to a TabbedPane object by using the addTab and insertTab methods. A tab is represented by an index corresponding to the position it was added in, where the first tab has an index equal to 0 and the last tab has an index equal to the tab count minus 1.

JTable

The JTable is used to display and edit regular two-dimensional tables of cells.

The JTable has many facilities that make it possible to customize its rendering and editing but provides defaults for these features so that simple tables can be set up easily. For example, to set up a table with 10 rows and 10 columns of numbers:

class MyTableModel extends AbstractTableModel{
public function getColumnCount():int { return 10; }
public function getRowCount():int { return 10;}
public getValueAt(row:int, col:int) { return row*col; }
};
var dataModel:MyTableModel = new MyTableModel();
var table:JTable = new JTable(dataModel);
var scrollpane:JScrollPane = new JScrollPane(table);

Note that if you wish to use a JTable in a standalone view (outside of a JScrollPane) and want the header displayed, you can get it using {@link #getTableHeader} and display it separately.

When designing applications that use the JTable it is worth paying close attention to the data structures that will represent the table's data. The DefaultTableModel is a model implementation that uses a Vector of Vectors of Objects to store the cell values. As well as copying the data from an application into the DefaultTableModel, it is also possible to wrap the data in the methods of the TableModel interface so that the data can be passed to the JTable directly, as in the example above. This often results in more efficient applications because the model is free to choose the internal representation that best suits the data. A good rule of thumb for deciding whether to use the AbstractTableModel or the DefaultTableModel is to use the AbstractTableModel as the base class for creating subclasses and the DefaultTableModel when subclassing is not required.

The JTable uses integers exclusively to refer to both the rows and the columns of the model that it displays. The JTable simply takes a tabular range of cells and uses getValueAt(int, int) to retrieve the values from the model during painting.

By default, columns may be rearranged in the JTable so that the view's columns appear in a different order to the columns in the model. This does not affect the implementation of the model at all: when the columns are reordered, the JTable maintains the new order of the columns internally and converts its column indices before querying the model.

To listen table row selection change event, by this.addSelectionListener() To listen column selection see org.aswing.table.TableColumnModel.addColumnModelListener
To listen other Table events see org.aswing.table.TableModel.addTableModelListener

JTextArea

A JTextArea is a multi-line area that displays text.

JTextComponent

JTextComponent is the base class for text components.

JTextComponent can be formated by ASFont, but some times you need complex format,then ASFont is not enough, so you can set a EmptyFont instance to the JTextComponent, it will do nothing for the format, then you can call this.setTextFormat, this.defaultTextFormat to format the text with TextFormat instances. And don't forgot to call Component.revalidate if you think the component size should be change after that. Because these method will not call Component.revalidate automatically.

JTextField

JTextField is a component that allows the editing of a single line of text.

JToggleButton

An implementation of a two-state button.
The JRadioButton and JCheckBox classes are subclasses of this class.

JToolBar

JToolBar provides a component that is useful for displaying commonly used 'Action's or controls.

JToolTip

Used to display a "Tip" for a Component. Typically components provide api to automate the process of using ToolTips. For example, any AsWing component can use the Component toolTipText method to specify the text for a standard tooltip. A component that wants to create a custom ToolTip display can create an owner ToolTip and apply it to a component by JToolTip.setComponent method.

JTree

A control that displays a set of hierarchical data as an outline.

JViewport

JViewport is an basic viewport to view normal components. Generally JViewport works with JScrollPane together, for example:

JWindow

JWindow is a Container, but you should not add component to JWindow directly, you should add component like this: window.content.append(child);

KeyAction

KeyMap

KeyMap is a key definition -> action map.

KeySequence

Key Sequence, defines a key sequence.

Thanks Romain for his Fever{@link http://fever.riaforge.org} accelerator framworks implementation, this is a simpler implementation study from his.

KeyStroke

KeyStroke is a single key definition.

Thanks Romain for his Fever{@link http://fever.riaforge.org} accelerator framworks implementation, this is a simpler implementation study from his.

KeyType

KeyType defined with description representing the key sequence with a string, codeSequence contains the key codes sequence. Same codeSequence will be considered as same key definition.

For example "C" and [67] mean the C key on the key board. "Ctrl+C" and [17, 67] mean the first Ctrl and then C keys.

Thanks Romain for his Fever{@link http://fever.riaforge.org} accelerator framworks implementation, this is a simpler implementation study from his.

KeyboardManager

Dispatched when key is down. @eventType flash.events.KeyboardEvent.KEY_DOWN

LayoutManager

Defines an interface for classes that know how to layout Containers based on a layout constraints object.

ListCell

Cell for JList.

ListCellFactory

List cell renderer factory, a ListCellFactory should not change it return value of these method isAllCellHasSameHeight, getCellHeight after created. Mean, if one of its instance method isAllCellHasSameHeight returned false, it should always return false.

ListModel

ListMode is a MVC pattern's mode for List UI, different List UI can connected to a same mode to view the mode's data. When the mode's data changed the mode should fire a event to all its ListDataListeners.

ListSelectionModel

This interface represents the current state of the selection for any of the components that display a list of values with stable indices. The selection is modeled as a set of intervals, each interval represents a contiguous range of selected list elements. The methods for modifying the set of selected intervals all take a pair of indices, index0 and index1, that represent a closed interval, i.e. the interval includes both index0 and index1.

LoadIcon

LoadIcon allow you load extenal image/animation to be the icon content.

LookAndFeel

Reserved for look and feel implementation.

MenuElement

Any component that can be placed into a menu should implement this interface. This interface is used by MenuSelectionManager to handle selection and navigation in menu hierarchies.

MenuSelectionManager

Dispatched when the menu selection changed.

MultipleAssetIcon

MultipleAssetIcon is a Icon impelmentation that use multiple decorative DisplayObject-s.

MutableListModel

MutableListMode is a MVC pattern's mode for List UI, different List UI can connected to a same mode to view the mode's data. When the mode's data changed the mode should fire a event to all its ListDataListeners.

Orientable

An component or any thing has HORIZONTAL or VERTICAL form.

RepaintManager

RepaintManager use to manager the component's painting.

ScrollPaneLayout

The layout manager used by JScrollPane.
JScrollPaneLayout is responsible for three components: a viewportable's pane, two scrollbars.

SimpleButton

SimpleButtonIcon

SimpleButtonIconToggle

SingleSelectionModel

A model that supports at most one indexed selection.

SoftBox

A JPanel with SoftBoxLayout.

SoftBoxLayout

The SoftBoxLayout will layout the child components using their preferredWidth or preferredHeight instead of width or height. It ignores the preferredWidth when set to Y_AXIS, ignores the preferredHeight when set to X_AXIS.

SolidBackground

A background decorator that paint a solid color. @author

StyleResult

The class for a result of a main color adjusted by a adjuster.

StyleTune

The style tune include factors to generate colors for gradient content and border, and include the round property and shaow alpha property.

This is used to affect the component's UI style.

TabInfo

ToggleButtonModel

The ToggleButton model

UIDefaults

A table of defaults for AsWing components. Applications can set/get default values via the UIManager.

UIManager

This class keeps track of the current look and feel and its defaults.

VectorListModel

The mutable list model vector implementation.

ViewportLayout

The default layout manager for JViewport. ViewportLayout defines a policy for layout that should be useful for most applications. The viewport makes its view the same size as the viewport, however it will not make the view smaller than its minimum size. As the viewport grows the view is kept bottom justified until the entire view is visible, subsequently the view is kept top justified.

Viewportable

A viewportable object can scrolled by JScrollPane, JScrollBar to view its viewed content in a visible area.

WeightBoxLayout

Each child will have a weight, for its width(X_AXIS) or height(Y_AXIS) share from parent.

WindowLayout

Layout for JWindow and JFrame.

WindowOrderFocusTraversalPolicy

The focus traversal policy for windows, the only different from ContainerOrderFocusTraversalPolicy is that it choose the first content pane component to be the default component.