krysalis-jcharts/src/java/org/krysalis/jcharts/designer/common/stroke StrokeChooser.java,1.2,1.3
"Nathaniel G. Auvil" <[email protected]> Thu, 03 Jun 2004 00:57:00 +0000
| Newsgroups | gmane.comp.krysalis.jcharts.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/jcharts/krysalis-jcharts/src/java/org/krysalis/jcharts/designer/common/stroke
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1974/src/java/org/krysalis/jcharts/designer/common/stroke
Modified Files:
StrokeChooser.java
Log Message:
Index: StrokeChooser.java
===================================================================
RCS file: /cvsroot/jcharts/krysalis-jcharts/src/java/org/krysalis/jcharts/designer/common/stroke/StrokeChooser.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** StrokeChooser.java 25 May 2004 01:04:07 -0000 1.2
--- StrokeChooser.java 3 Jun 2004 00:56:58 -0000 1.3
***************
*** 33,37 ****
************************************************************************************************/
-
package org.krysalis.jcharts.designer.common.stroke;
--- 33,36 ----
***************
*** 41,55 ****
import java.awt.Stroke;
import org.krysalis.jcharts.designer.common.LabelledTextfield;
import org.krysalis.jcharts.properties.util.ChartStroke;
- import javax.swing.*;
-
! /*************************************************************************************
! *
* @author Nathaniel Auvil
* @version $Id$
! ************************************************************************************/
public class StrokeChooser extends JPanel
{
--- 40,57 ----
import java.awt.Stroke;
+ import javax.swing.BorderFactory;
+ import javax.swing.BoxLayout;
+ import javax.swing.JPanel;
+
import org.krysalis.jcharts.designer.common.LabelledTextfield;
+ import org.krysalis.jcharts.designer.common.paint.PaintChooser;
import org.krysalis.jcharts.properties.util.ChartStroke;
! /*****************************************************************************************
! *
* @author Nathaniel Auvil
* @version $Id$
! ****************************************************************************************/
public class StrokeChooser extends JPanel
{
***************
*** 57,120 ****
private EndCapsCombo endCaps;
private LineJoinsCombo lineJoins;
!
! private JRadioButton noStroke;
!
!
! public StrokeChooser( String title, boolean showNoStroke )
! {
! super();
! super.setBorder( BorderFactory.createCompoundBorder( BorderFactory.createTitledBorder( title ),
! BorderFactory.createEmptyBorder( 5, 5, 5, 5 ) ) );
!
! this.setLayout( new BoxLayout( this, BoxLayout.Y_AXIS ) );
!
! this.widthField= new LabelledTextfield( "Width", 4 );
! super.add( this.widthField );
!
! this.endCaps= new EndCapsCombo();
! super.add( this.endCaps );
!
! this.lineJoins= new LineJoinsCombo();
! super.add( this.lineJoins );
!
! }
!
! /***********************************************************************************
! *
* @param title
! **********************************************************************************/
public StrokeChooser( String title )
{
! super();
! super.setBorder( BorderFactory.createCompoundBorder( BorderFactory.createTitledBorder( title ),
! BorderFactory.createEmptyBorder( 5, 5, 5, 5 ) ) );
!
this.setLayout( new BoxLayout( this, BoxLayout.Y_AXIS ) );
! this.widthField= new LabelledTextfield( "Width", 3 );
! this.widthField.setText( "1" );
! super.add( this.widthField );
! this.endCaps= new EndCapsCombo();
! super.add( this.endCaps );
! this.lineJoins= new LineJoinsCombo();
! super.add( this.lineJoins );
}
! /*****************************************************************
*
* @return ChartStroke
! ****************************************************************/
public ChartStroke getChartStroke()
! {
! Stroke stroke= new BasicStroke( Float.valueOf( this.widthField.getText() ).floatValue(),
! this.endCaps.getEndCapsConstant(),
! this.lineJoins.getLineJoinsConstant() );
! return new ChartStroke( stroke, Color.BLACK );
! //TODO need to get the Paint
}
! }
--- 59,109 ----
private EndCapsCombo endCaps;
private LineJoinsCombo lineJoins;
! private PaintChooser paintChooser;
! /***************************************************************************************
! *
* @param title
! **************************************************************************************/
public StrokeChooser( String title )
{
! super.setBorder( BorderFactory.createCompoundBorder( BorderFactory.createTitledBorder( title ), BorderFactory.createEmptyBorder( 5, 5, 5, 5 ) ) );
this.setLayout( new BoxLayout( this, BoxLayout.Y_AXIS ) );
! JPanel fields= new JPanel();
! fields.setLayout( new BoxLayout( fields, BoxLayout.X_AXIS ) );
! super.add( fields );
!
! this.widthField = new LabelledTextfield( "Width", 3 );
! fields.add( this.widthField );
! this.endCaps = new EndCapsCombo();
! fields.add( this.endCaps );
! this.lineJoins = new LineJoinsCombo();
! fields.add( this.lineJoins );
!
! this.paintChooser= new PaintChooser( true, Color.black, Color.black );
! super.add( this.paintChooser );
}
! /***************************************************************************************
*
* @return ChartStroke
! **************************************************************************************/
public ChartStroke getChartStroke()
! {
! if( this.widthField.getText().equals( "" ) || this.widthField.getText().equals( "0" ) )
! {
! return null;
! }
! else
! {
! Stroke stroke = new BasicStroke( Float.valueOf( this.widthField.getText() ).floatValue(),
! this.endCaps.getEndCapsConstant(),
! this.lineJoins.getLineJoinsConstant() );
! return new ChartStroke( stroke, this.paintChooser.getPaint() );
! }
}
! }
\ No newline at end of file
-------------------------------------------------------
This SF.Net email is sponsored by the new InstallShield X.
From Windows to Linux, servers to mobile, InstallShield X is the one
installation-authoring solution that does it all. Learn more and
evaluate today! http://www.installshield.com/Dev2Dev/0504