Adopters: Abeille

Discussion of your thoughts & requests, help for users and game specific configuration files for Character Tool

Moderators: dorpond, Azhrei

User avatar
jay
RPTools Team
Posts: 1767
Joined: Tue Feb 07, 2006 1:07 am
Location: Austin, Tx

Adopters: Abeille

Post by jay »

This thread is to talk about using Abeille to generate forms that can be used to display characters. There isn't anything here that you are required to know to be able to run CT, this is just something you need to know if you want to create your own character sheets for your own game settings file or character specific sheets in one of the existing game settings file.

User avatar
jay
RPTools Team
Posts: 1767
Joined: Tue Feb 07, 2006 1:07 am
Location: Austin, Tx

Post by jay »

You can download the Abeille Forms builder here. Download version 2.0. That is the version being used within CT, IT & MT. Unzip this file and double click the designer.jar file to run it. Abeille requires a project file to be created before allowing forms to be edited. There is one that can be used in the chartool project on SVN if it has been downloaded, but it is also possible to just create a new one and use that. The project file contains directories that are searched for source files and images. I've pointed the CT project file at the chartool\src directory and several of the game settings files directories that I keep unzipped in SVN. More on this later.

Once the project is set up it is time to create a form. Select File->New Form. An empty grid will be displayed in the middle panel. To the left of this grid is a toolbar containing all of the components. Select a component from the toolbar and then select a cell in the grid to add the component. Across the top of the grid is a toolbar with File and Edit menu buttons and then a set of buttons for manipulating rows & columns. On the right side is the Form Properties pane. It has several tabs for editing properties on the selected component. The Component tab lets all of the component's properties be edited. The second tab is for editing the Column containing the selected component. The third tab is for editing the Row containing the selected component. The last tab is for the specific cell. I'll go into greater deal on all of these panels in a later post about using the tool for CT forms.

I don't know that I can describe how the form layout works. It is a visual tool so really the only thing to do is to try it out. There is some documentation in Abeille's help file on editing everything. There is some documentation for the actual layout manager use by Abeille here.

I've added some components that can used within Abielle. They allow scripts to be attached to the normal swing components. These are the same sort of scripts that get put into the property mapping only they work on UI components. Abeille has to be set up properly for these components to be used. To do this:
  1. Download the Character Tool zip file from the RPTools site and unzip it. This step can be skipped if the chartool project has already been downloaded from SVN.
  2. Start Abeille
  3. Select Tools->Java Bean Manager from the menu.
  4. The next steps are dependent on the choice made in the first step. If the Character Tool zip file is used:
    1. Click Add Jar
    2. Add the chartool-0.1.b*.jar It is in the directory where Character Tool is unzipped.
    3. Repeat for the jide-common.1.9.4.09.jar, jide-grids.1.9.4.09.jar and parser-1.0.b*.jar. these are in the lib directory off of the directory where the Character Tool zip file was unzipped.
    If the chartool project has been downloaded from SVN do these steps instead:
    1. Click Add Path
    2. Add the location of the chartool/build directory which is within the project. It may not be their if the project hasn't been loaded into Eclipse.
    3. Click Add Jar
    4. Add the parser-1.0.b*.jar in the chartool project's chartool/lib directory.
    5. Repeat this for the jide-common.1.9.4.09.jar and jide-grids.1.9.4.09.jar files.
    You may get some messages from Abeille about unlicensed use of Jide components, but you can ignore them. They will go away when you run the form in CT because it has a valid open source license for those jars. Note that the chartool and parser jar build numbers may change between releases of CT.
  5. Click on the Add Bean button back on the Java Bean Manager Dialog
  6. Add the following beans here:
    • net.rptools.chartool.ui.charsheet.component.CharSheetButton
    • net.rptools.chartool.ui.charsheet.component.CharSheetComboBox
    • net.rptools.chartool.ui.charsheet.component.CharSheetJideButton
    • net.rptools.chartool.ui.charsheet.component.CharSheetTable (Check Scrollable for this component)
    • net.rptools.chartool.ui.charsheet.component.CharSheetLabel
    • net.rptools.chartool.ui.charsheet.component.CharSheetRadioButton
    • net.rptools.chartool.ui.charsheet.component.CharSheetTextField
    • net.rptools.chartool.ui.charsheet.component.CharSheetImage
    • net.rptools.chartool.ui.charsheet.component.CharSheetTextArea (Check Scrollable for this component)
    • net.rptools.chartool.ui.charsheet.component.CharSheetEditorPane (Check Scrollable for this component)
    • net.rptools.chartool.ui.charsheet.component.CharSheetCheckBox
    • net.rptools.chartool.ui.charsheet.component.CharSheetRepeatingPanel (Check Scrollable for this component)
    • net.rptools.chartool.ui.charsheet.component.CharSheetSpinner (Coming build 15)
Now these components can be added to forms as well as the normal Swing components. These components have a set of properties called xxxScript where either JavaScript or RPScript can be used to set values, change colors, or perform special setup on the component. There will also be more details on this in a later post.

Abeille will allow images to be displayed in all of its components. They can be used as background images for the entire form or a single cell. Components that use images like labels and buttons can also have their images set by Abeille. The game settings files hold these images and CT makes sure they are available to the form at runtime. Follow these steps to allow access to the images within a game settings file:
  1. Unzip the game settings file being worked on in a local directory. The files shipped with CT are in the C:\Documents and Settings\user-name\.chartool\game directory on Windows XP.
  2. Start Abeille
  3. Select Tools->Project Settings from the menu
  4. Select the Source Tab
  5. Choose Add Path
  6. Select the directory where the game settings file was unzipped in the file dialog that pops up. It has to be the base directory and not the images directory already available in some of the game settings files.
Unzipping the game settings file also allows you to edit the forms directly so that when the RPGame file is re-zipped the changes to the forms will be included automatically. To add a new image for use in Abeille just copy it into the images directory under the directory where the game settings file was unzipped. Create the images directory if it doesn't exist. It is OK to add any sub-directories under the images directory that are needed. GIF, JPEG, & PNG images are the only image types supported by Abeille.

That is about it for setting up Abeille. In later posts I'll talk about linking properties to components and how CT does the population, how scripts are written, and how the data is accessed from a script on a component.
Last edited by jay on Sat Nov 19, 2011 3:09 pm, edited 3 times in total.

Fobbo
Giant
Posts: 196
Joined: Wed Feb 01, 2006 2:11 pm

Post by Fobbo »

I started to get Abeille Forms builder setup, including the CT specific jave beans but I ran into in issue with a few of them namely: net.rptools.chartool.ui.charsheet.component.CharSheetComboBox

This I can not seem to add.

User avatar
jay
RPTools Team
Posts: 1767
Joined: Tue Feb 07, 2006 1:07 am
Location: Austin, Tx

Post by jay »

I updated the Combo Box on the code I dropped the other day. Maybe that has something to do with it? Did you get any exceptions from Abeille.

User avatar
jstgtpaid
Giant
Posts: 142
Joined: Sun Jun 22, 2008 1:23 am
Location: Tampa, FL

Post by jstgtpaid »

I imported all the beans however only five new beans made it to my panel. I can see the jide button in the form Jay created, but I don't have a bean for it.

Any idea on how to fix that?

User avatar
jay
RPTools Team
Posts: 1767
Joined: Tue Feb 07, 2006 1:07 am
Location: Austin, Tx

Post by jay »

I don't know for sure what the problem is but it sounds like one of the jar files you entered isn't right. The latest version of CT has a new parser library in it, so you would have to fix that as well. Are you getting any exceptions?

User avatar
jstgtpaid
Giant
Posts: 142
Joined: Sun Jun 22, 2008 1:23 am
Location: Tampa, FL

Post by jstgtpaid »

I got it to work... My only wish now is that I could change the icons from beans to the appropriate icon...


I love the new form!! Tabs are cool... I have been trying to figure out the tabs... Do you have to rename the tab and resize it before you can drop subforms in it?

User avatar
jay
RPTools Team
Posts: 1767
Joined: Tue Feb 07, 2006 1:07 am
Location: Austin, Tx

Post by jay »

There aren't any images for them, hence the bean. If you have some there is a way to add them to the bean on the preferences panel where you entered their names. I've been using the silk icons for some of them.

You do need to create a tab first. The new tab, will have a subform already in it.

User avatar
jstgtpaid
Giant
Posts: 142
Joined: Sun Jun 22, 2008 1:23 am
Location: Tampa, FL

Post by jstgtpaid »

jay wrote: That is about it for setting up Abeille. In later posts I'll talk about linking properties to components and how CT does the population, how scripts are written, and how the data is accessed from a script on a component.
I am really looking forward to this.

User avatar
jay
RPTools Team
Posts: 1767
Joined: Tue Feb 07, 2006 1:07 am
Location: Austin, Tx

Linking Components To Forms

Post by jay »

This post describes how to link a property from the propertyDescriptorSet.xml (PDS) to a component in an Abeille form.

The simplest way to do the link is to set the name of the property as the name of the component in Abeille. When the form is loaded the names of the components are compared to the properties defined in the PDS. If there is a match then the type of component(label, text, table etc.) is checked to see if there is a way to display the data type of the property (STRING, NUMBER, etc.). Not all components are supported with all data types. For instance, the SCRIPT type value isn't editable so it doesn't make any since to show it in a text field which is editable. See the table below for a mapping of data types to components. If the type of data can be displayed in the component and the component is Character Sheet Component (CSC) then the onLoadScript is executed. The onLoadScript has no character data available to it. It can only set values on the component that could not be set by Abeille's editor.

The component names linked to properties should follow the normal parent-name.child-name notation for properties that aren't in the root of the PDS. Components without a name are ignored. If a component name is required for scripts but isn't needed to link the component to a property, then add an underscore to the beginning of the name. This can useful if a script on one component needs to find the instance of another component on the form. If the name starts with an underscore it isn't linked to a property, but the onLoadScript for CSC's is still executed. If a component has a name that isn't a defined property name and it doesn't start with an underscore an error message will be displayed on the console showing the problem.

The following list shows which components can display a given data type:
  • BOOLEAN: JToggleButton, JCheckBox, JRadioButton, CharSheetCheckBox, & CharSheetRadioButton. The boolean value can be edited by all of these components.
  • NUMBER: JLabel, JETALabel, JTextField, JTextArea, JEditorPane, JTextPane, JComboBox, CharSheetComboBox, CharSheetEditorPane, CharSheetLabel, CharSheetTextArea. & CharSheetTextField. The number value can be edited in all components except the JLabel & JETALabel components.
  • STRING: JLabel, JETALabel, JTextField, JTextArea, JEditorPane, JTextPane, JComboBox, CharSheetLabel, CharSheetComboBox, CharSheetEditorPane, CharSheetLabel, CharSheetTextArea, & CharSheetTextField. The string value can be edited in all components except the JLabel & JETALabel components.
  • MAP: CharSheetTable can display the entire map and edit child properties of types BOOLEAN, NUMBER & STRING. CharSheetLabel, CharSheetButton & CharSheetJideButton will accept map data but it is not displayed. It is used in scripts.
  • LIST: CharSheetTable can display the entire list and edit child properties of types BOOLEAN, NUMBER & STRING. CharSheetLabel will accept list data but it is not displayed. It is used in scripts. The values in a list may be shown as the contents of the drop-down on CharSheetComboBox components even if the component isn't linked directly to the combo box.
  • SLOT: A slot supports the same components as a MAP except that only BOOLEAN, NUMBER & STRING type properties defined as slot modifiable can be edited. Also, the CharSheetComboBox will allow the value of the SLOT itself to be modified.
  • IMAGE: JLabel, JETALabel & CharSheetLabel can display an image. CharSheetImage can display and edit an image.
  • SCRIPT: JLabel, JETALabel & CharSheetLabel can display script results. JButton, CharSheetButton & CharSheetJideButton can execute scripts defined in the PSD to perform special tasks and output messages to the user.
Once the components and properties are linked the component values are populated. They are populated every time the character sheet changes. This is because a change to a property may change the values of all scripts that depend on the modified property value. The population is performed automatically if the value is edited directly by a component. If a script edits something it must call the method rpController.setFields() to have the values updated. Every time the component value is set the onSetValue script is executed. This script will have the parent of the linked property as its context and has complete access to all character data. The onSetValue script must set the value of its component before it exits as the CSC's won't do the work when a script is defined. Also note that the onSetValue script is not called if the CSC does not have a linked property. Therefore the name of the component should be set to an appropriate property (root will always work) to make sure it is called on all changes of the character data. This allows for values not in the PDS to be calculated and displayed and makes sure they are updated when character data changes. The RPScript function setText(rpComponent, text) can be called to calculate simple values for components that show text (JLabel, JETALabel, JTextField, JTextArea, JEditorPane, CharSheetLabel, CharSheetTextField, CharSheetTextArea, & CharSheetEditorPane). There are also RPScript functions that can set colors (setBackground(rpComponent, color) & setForeground(rpComponent, color)) and enable or disable the component (setEnabled(rpComponent, boolean)). In JavaScript no special methods are needed since they can be called directly on the component using the rpComponent variable.

Some of the other CSC components have other scripts that can be executed. CharSheetButton, CharSheetJideButton CharSheetRaidoButton & CharSheetCheckBox have an actionScript that is executed when the button is pressed. CharSheetComboBox has an actionScript that is executed when the user selects anything in the drop down list. CharSheetTable has a doubleClickScript which is called when a user double clicks a row in the table and selectionScript which is called when the user modifies the selected rows in the table. There is also an onColumnRender script that can be used to modify the renderer used to paint a cell. The combo box and table CSC's have special methods that can be used to get the selected value as a property. All of the scripts listed here have the linked property value's parent node as its context so there is access to all of the character data.

All scripts are entered as plain text into a component property with the given name. Start JavaScript scripts with the string JavaScript:: so that the proper parser is used on it. RPScript is the default so no name is required for those scripts. I will provide more details on what variables are available to all components scripts in a later post.

The CharSheetComboBox has special properties on it that are used to control what is shown in the drop down. The property named comboBoxModelProp controls where the data for the drop-down is located. If it is empty then the values in comboBoxModelRows are the individual strings displayed in the drop-down. If the comboBoxModelProp contains the name of a MAP or SLOT property then the value in comboBoxModelRows contains the names of the properties whose values are shown in the drop-down. If the comboBoxModelProp contains a LIST then the comboBoxModelRows contains the index of each item in the list that is shown. If the comboBoxModelTable is set the individual rows are read from one of the database tables in the game settings file. The comboBoxModelProp & comboBoxModelRows are ignored when this property is set. The other property unique to the CharSheetComboBox is comboBoxModelEmpty which is the string that is displayed when the value of the property linked to the component is empty.

The CharSheetTable also has special properties. The rows property contains the list child property names of the linked property that define the rows of the table, if that linked property is a MAP or SLOT. If it is a LIST then each element in the list is a row in the table. The columns property contains the names of the properties in each row to be displayed as columns. To restrict the size of a column follow the name with (###) where the ### is the fixed width of the column in pixels. The header for the columns will either contain the names in this component property or it will contains the display names if the columns can be attached to property descriptors from the PDS. Columns that are BOOLEAN, NUMBER or STRING data types as defined by the PDS will be editable if the linked component property is a MAP or a SLOT and the column is slot modifiable. The CharSheetTable columns are sortable and resizable (if width not fixed). The sort columns and columns sizes can be saved it he preferencesName property is set to something unique to the form. If it isn't unique then the preferences may be overwritten by other tables.

If some (all? :)) of this isn't clear please ask and I'll try to clarify.

User avatar
Hawke
Great Wyrm
Posts: 2261
Joined: Sat Apr 21, 2007 12:12 am
Location: Albuquerque, NM

Post by Hawke »

I'm unfamiliar with Abeille... but is this a step toward printable character sheets?

User avatar
jay
RPTools Team
Posts: 1767
Joined: Tue Feb 07, 2006 1:07 am
Location: Austin, Tx

Post by jay »

Abeille is the tool used to create the character sheets in CT. Most of the time they can't be printed because they have scroll panes in them which hide some of the data within them. I'm going to have to figure something else out for printing.

User avatar
Hawke
Great Wyrm
Posts: 2261
Joined: Sat Apr 21, 2007 12:12 am
Location: Albuquerque, NM

Post by Hawke »

jay wrote:Abeille is the tool used to create the character sheets in CT. Most of the time they can't be printed because they have scroll panes in them which hide some of the data within them. I'm going to have to figure something else out for printing.
Got it - thank you!

Toran
Kobold
Posts: 10
Joined: Thu Jul 17, 2008 5:03 am

Post by Toran »

jay wrote:I've added some components that can used within Abielle. They allow scripts to be attached to the normal swing components. These are the same sort of scripts that get put into the property mapping only they work on UI components. Abeille has to be set up properly for these components to be used. To do this:
  1. Download the Character Tool zip file from the RPTools site and unzip it. This step can be skipped if the chartool project has already been downloaded from SVN.
  2. Start Abeille
  3. Select Tools->Java Bean Manager from the menu.
  4. The next steps are dependent on the choice made in the first step. If the Character Tool zip file is used:
    1. Click Add Jar
    2. Add the chartool-0.1.b*.jar It is in the directory where Character Tool is unzipped.
    3. Repeat for the jide-common.1.9.4.09.jar, jide-grids.1.9.4.09.jar and parser-1.0.b*.jar. these are in the lib directory off of the directory where the Character Tool zip file was unzipped.
    If the chartool project has been downloaded from SVN do these steps instead:
    1. Click Add Path
    2. Add the location of the chartool/build directory which is within the project. It may not be their if the project hasn't been loaded into Eclipse.
    3. Click Add Jar
    4. Add the parser-1.0.b*.jar in the chartool project's chartool/lib directory.
    5. Repeat this for the jide-common.1.9.4.09.jar and jide-grids.1.9.4.09.jar files.
    You may get some messages from Abeille about unlicensed use of Jide components, but you can ignore them. They will go away when you run the form in CT because it has a valid open source license for those jars. Note that the chartool and parser jar build numbers may change between releases of CT.
  5. Click on the Add Bean button back on the Java Bean Manager Dialog
  6. Add the following beans here:
    • net.rptools.chartool.ui.charsheet.component.CharSheetButton
    • net.rptools.chartool.ui.charsheet.component.CharSheetComboBox
    • net.rptools.chartool.ui.charsheet.component.CharSheetJideButton
    • net.rptools.chartool.ui.charsheet.component.CharSheetTable
    • net.rptools.chartool.ui.charsheet.component.CharSheetLabel
    • net.rptools.chartool.ui.charsheet.component.CharSheetRadioButton
    • net.rptools.chartool.ui.charsheet.component.CharSheetTextField
    • net.rptools.chartool.ui.charsheet.component.CharSheetImage
    • net.rptools.chartool.ui.charsheet.component.CharSheetTextArea (coming in build 9)
    • net.rptools.chartool.ui.charsheet.component.CharSheetEditorPane(coming in build 9)
I have followed these steps precisely, but I only get two beans imported, which are 'CharSheetTextArea' and 'CharSheetEditorPane'.

Has anything relevant changed since you wrote these instructions?

User avatar
jay
RPTools Team
Posts: 1767
Joined: Tue Feb 07, 2006 1:07 am
Location: Austin, Tx

Post by jay »

I don't think so. You may have gotten a stack trace from Abeille. Could you post it?

Post Reply

Return to “CharacterTool”