Previous iTool User's Guide: Working with Styles Next

Creating Styles

There are two ways a new Personal Style can be created. You can use the iTool's Style Editor or you can select one or more visualizations within your iTool view (or the view itself) and create a new style. Both of these options are discussed here.

Creating a Style from the Current Visualization

You can create a new style by selecting one or more visualization objects within the view (or by selecting the entire view). A new style created in this manner will contain all property settings of the selected objects (or all objects in the view if nothing was selected).

Creating a Style From All Items in a View

The following example shows how to create a new style from all items in a view:

  1. From the IDL Command Line, plot a simple line graph within iPlot:
  2. iPlot, RANDOMU(seed, 30)  
    

     

  3. From the iPlot window, select one or more visualization objects or the entire view within the window. Then select: Edit Style Create Style from Selection...
  4.  

  5. Enter a name for your new style (in this example it is named MyNewStyle1) in the Create Style from Selection dialog shown in the following figure.

 

Figure 9-1: Create Style from Selection Dialog (MyNewStyle1 Style)

Figure 9-1: Create Style from Selection Dialog (MyNewStyle1 Style)
  1. Now you can select between creating the new style using the selected items or using all items in the view. In this instance, choose Create using all items in view.
  2.  

  3. Select OK and the iTools Style Editor appears.
  4.  

  5. You can now expand the newly named style to view its properties. Under MyNewStyle1, select Plot and change the Color to your preference as shown here:
  6.  

    Figure 9-2: Selecting Background Color

    Figure 9-2: Selecting Background Color

     

  7. Change the Symbol to Asterisk.
  8.  

  9. Now, from the Style Editor window, select the Axis object and change the color.
  10.  

  11. Select File Save to save changes to MyNewStyle1.
  12.  

  13. Next, from the iPlot window, select Edit Style Apply Style and select MyNewStyle1 from the Apply Style dialog that appears. Your new style, which contains changes to your line style color, plot symbol type (asterisks) and color of plot axes, is applied to the plot object.
  14.  


    Note
    If multiple items of the same class are within a container (e.g. the axes container), the first one within the container will be used when creating the style.

Creating a Style From Selected Items

The following example shows how to create a new style from selected items within an iTool view:

  1. From your existing iPlot window, select the text annotation tool (the letter A on the top of the window on the annotation toolbar).
  2.  

  3. Click anywhere in the window you wish to add a title for your plot. Type in "My Plot".
  4.  

  5. Double-click on your new text annotation, and the Visualization Browser appears. Here you can edit the properties of your annotation. Change the text font, size, and color.
  6.  

  7. With your text annotation "My Plot" is selected (a box appears around the title when selected), select Edit Style Create Style from Selection...
  8.  

  9. Enter a name for your new style in the Create Style from Selection dialog shown in the following figure.

 

Figure 9-3: Create Style from Selection Dialog (NewTextStyle1 Style)

Figure 9-3: Create Style from Selection Dialog (NewTextStyle1 Style)
  1. Name your new style NewTextStyle1. Now you can select between creating the new style using the selected items or using all items in the view. In this instance, choose Create using selected items.
  2.  

  3. Select OK and the iTools Style Editor appears.
  4.  

  5. Since we have already set our text options as we want them to appear, you can close the Style Editor.
  6.  

  7. Now open a new iPlot window and add a new title (for example, "My New Plot") using the text annotation tool.
  8.  

  9. Select Edit Style ApplyStyle and select to apply NewTextStyle1. This applies the personal text style to the new annotation.

For details on applying a style to selected items or to all items within a view, or when launching an iTool, see Applying Styles. For information on modifying existing styles, see Editing Styles.


Note
If nothing is currently selected, then the Visualization Layer within the current view will be used when creating the style.

Creating a Style from Multiple Selected Items

Within an iTool view, you can select one or more visualization objects or annotations (or a combination of the two) to be included in a new Personal Style. To select one object or annotation simply click on the item. To select multiple items, select the first and then, holding down the Ctrl key, click on the other items.

Changes to the properties of the object or annotation can be made prior to creating a new style (by double-clicking on the item and altering the properties in the Visualization browser) or after creating a new style (within the iTools Style Editor).


Note
If multiply items of the same class are selected (say two axes), the first one selected will be used when creating the style.

Creating a New Style from the Style Editor

The Style Editor can be used to manually create a new style and specify the values of individual properties. Options are available in the Style Editor to duplicate existing styles, or to copy items from one style to another.

The following example shows how to create a new style using the iTool's Style Editor:

  1. First, open any iTool window and import some data.
  2.  

  3. From the iTool window, select Edit Style Style Editor... The iTools Style Editor window appears.
  4.  

  5. You will see My Styles, System Styles, and Current Style listed. Select Current Style and right-click and select Duplicate. A Copy of Current Style appears under My Styles and is named Copy of Current Style.
  6.  


    Note
    From the iTool window you can also select File New Style.

     

  7. Select the Copy of Current Style and rename it to your desired name in the right-hand side of the Editor.
  8.  


    Note
    To avoid confusion, styles should be given unique names. You may not name a style the same name as an IDL system style.

     

  9. You are now able to make any changes within the new style by expanding the new style's object tree and making changes to the properties of individual visualization objects.
  10.  

  11. When finished, select File Save.
  12.  

    Figure 9-4: The iTool's Style Editor

    Figure 9-4: The iTool's Style Editor

     


    Note
    For more information on how to populate the new style with properties, see Editing Styles.

Working with the Current Style

The Current Style contains the properties that will be used to create new visualizations in the current tool. The Current Style can be found in the iTools Style Editor. The Current Style can be modified by:

  • Changing individual property values. These changes can be copied into another style, or applied to a visualization when the Current Style item is selected.
  •  

  • Updating the Current Style when applying style modifications. See Applying Styles for details.
  •  

  • Updating the Current Style from a style in the Style Editor. Select a Personal or System style and select Update Current Tool Style from the context menu or Apply menu.


Note
The Current Style is not saved between IDL sessions or between iTools. Because of this, one use of the Current Style can be as a practice area to define new styles. Changes can be made to the Current Style and then used to create your desired style. You can then save this new style under a new name. The new style can be set as the "Default style" in the Preferences. For more information on setting a default style, see Setting the Default Style.

Copying an Existing Style

Any existing style can be copied within the Style Editor. This is useful when you want to change only a few style properties while maintaining the majority of a style's existing properties. Simply click on the style name and choose Edit Copy or Edit Duplicate. Alternately, you can right-click on the style and choose Duplicate (or Copy and then Paste). A style named "Copy of style name" is then added in the My Styles folder of the Style Editor.


Note
Styles may be named and renamed as you wish.

  IDL Online Help (March 01, 2006)