Package org.krysalis.jcharts.designer.tabs.allChart.items

Source Code of org.krysalis.jcharts.designer.tabs.allChart.items.EdgePadding


package org.krysalis.jcharts.designer.tabs.allChart.items;


import java.awt.FlowLayout;

import javax.swing.BorderFactory;
import javax.swing.JPanel;

import org.krysalis.jcharts.designer.common.LabelledTextfield;
import org.krysalis.jcharts.designer.exceptions.DesignerException;


public class EdgePadding extends JPanel
{
  private String title;
  private LabelledTextfield padding;


  /***********************************************************************************
   *
   * @param title
   **********************************************************************************/
  public EdgePadding( String title )
  {
    super();
      this.title= title;

    super.setBorder( BorderFactory.createCompoundBorder( BorderFactory.createTitledBorder( this.title ),
                                        BorderFactory.createEmptyBorder( 5, 5, 5, 5 ) ) );

    this.setLayout( new FlowLayout() );

    this.padding = new LabelledTextfield( "Pixels:", 4 );
    this.padding.setText( Float.toString( 5 ) );
    this.add( this.padding );
  }


   /*********************************************************************************
   *
   * @return float
   ********************************************************************************/
  public float getEdgePadding() throws DesignerException
  {
    if( this.padding.getText().trim().equals( "" ) )
    {
      throw new DesignerException( "Edge Padding can not be NULL." );
    }
   
    return Float.parseFloat( this.padding.getText() );
  }
}
TOP

Related Classes of org.krysalis.jcharts.designer.tabs.allChart.items.EdgePadding

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.