arcgissamples\cartography\propertypage\SimpleRendererPropertyPageUI.java—ArcObjects 10.4 Help for Java | ArcGIS for Desktop
Simple dispersal renderer
arcgissamples\cartography\propertypage\SimpleRendererPropertyPageUI.java
/* Copyright 2015 ESRI
* 
* All rights reserved under the copyright laws of the United States
* and applicable international laws, treaties, and conventions.
* 
* You may freely redistribute and use this sample code, with or
* without modification, provided you include the original copyright
* notice and use restrictions.
* 
* See the use restrictions at <your ArcGIS install location>/DeveloperKit10.4/userestrictions.txt.
* 
*/
package arcgissamples.cartography.propertypage;

import java.awt.Rectangle;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.UIManager;
import javax.swing.border.TitledBorder;

public class SimpleRendererPropertyPageUI extends JFrame{
  private JPanel jContentPane = null;
  private JLabel jLabel = null;
  private JTextField jTextField = null;
  private JPanel jPanel = null;
  private JLabel jLabel1 = null;
  /**
   * This is the default constructor
   */
  public SimpleRendererPropertyPageUI() throws Exception {
    initialize();
  }
  
  /**
   * This method initializes the frame
   * @return void
   */
  private void initialize() throws Exception {
    this.setSize(424, 254);
    this.setResizable(false);
    this.setContentPane(getJContentPane());
    this.setTitle("Dispersal Property Page");
  }
  /**
   * This method creates a ContentPane for the panel
   * @return javax.swing.JPanel
   */
  private JPanel getJContentPane() throws Exception {
    if (jContentPane == null) {
      jContentPane = new JPanel();
      jContentPane.setLayout(null);
      jContentPane.add(getJPanel(), null);
    }
    return jContentPane;
  }

  /**
   * This method creates a Panel 
   * 
   * @return javax.swing.JPanel 
   */
  private JPanel getJPanel() {
    if (jPanel == null) {
      jPanel = new JPanel();
      jPanel.setLayout(null);
      jPanel.setBounds(new Rectangle(8, 14, 405, 206));
      TitledBorder titled = new TitledBorder("Change Dispersal Ratio");
      jPanel.setBorder(titled);

      //Create a label that displays 'Dispersal Ratio'
      jLabel = new JLabel();
      jLabel.setText("Dispersal Ratio");
      jLabel.setBounds(new Rectangle(14, 97, 83, 27));
      
      //Add label to the panel
      jPanel.add(jLabel, null);
      
      //Create and add a textfield to accept dispersal ratio value to the panel
      jPanel.add(getJTextField(), null);

      //Create an information label
      jLabel1 = new JLabel();
      jLabel1.setBounds(new Rectangle(12, 35, 385, 40));
      jLabel1.setText("This ratio affects how far the marker symbol is moved from it's original location");

      //Add label to the panel
      jPanel.add(jLabel1, null);
    }
    return jPanel;
  }

  /**
   * This method creates a TextField that could accept dispersal ratio for the pointDispersalRenderer
   * @return javax.swing.JTextField 
   */
  public JTextField getJTextField() {
    if (jTextField == null) {
      jTextField = new JTextField();
      jTextField.setBounds(new Rectangle(107, 98, 100, 27));
    }
    return jTextField;
  }

  static {
    try {
      UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    }catch (Exception e){e.printStackTrace();}
  }

  public static void main(String[] args) throws Exception {
    SimpleRendererPropertyPageUI thisclass = new SimpleRendererPropertyPageUI();
  }
}