1 +--102 lines: package com.acmemail.judah.cartesian_plane.components;---------------------------------------------------------------------------------------
103 * </li>
104 * </ul>
105 * @author Jack Straub
106 */
107 public class ColorEditor
108 {
-------------------------------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------------------------------
109 /** The default color, encoded as an integer string. */
110 private static final String defColorString = "0x0000FF";
111 /** The default color. */
112 private static final Color defColor =
113 Color.decode( defColorString );
114
115 /** The colorButton component. */
116 private final JButton colorButton = new JButton( "Color" );
-------------------------------------------------------------------------------------------------------------------------------------------------------
117 /** The textEditor component. */
118 private final JTextField textEditor =
119 new JTextField( defColorString, 10 );
120 /** The feedback component. */
121 private final JPanel feedback = new JPanel();
122 /** ColorSelector dialog. */
123 +-- 25 lines: private final ColorSelector colorDialog = ---------------------------------------------------------------------------------------------------
148 Font newFont = new Font( name, style, size );
149 textEditor.setFont( newFont );
150
151 feedback.setBackground( defColor );
152 textEditor.addActionListener( e -> editColor() );
153 colorButton.addActionListener( e -> selectColor() );
-------------------------------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------------------------------
154 }
155
156 /**
157 * Adds a given listener
158 * to the list of ActionListeners
159 * that are notified
160 +--182 lines: * when the selected color changes.-----------------------------------------------------------------------------------------------------------
|
1 +--102 lines: package com.acmemail.judah.cartesian_plane.components;---------------------------------------------------------------------------------------
103 * </li>
104 * </ul>
105 * @author Jack Straub
106 */
107 public class ColorEditor
108 {
109 public static final String COLOR_BUTTON_LABEL = "Color";
110 public static final String TEXT_EDITOR_NAME = "Text Editor";
111 public static final String FEEDBACK_NAME = "Feedback";
112
113 /** The default color, encoded as an integer string. */
114 private static final String defColorString = "0x0000FF";
115 /** The default color. */
116 private static final Color defColor =
117 Color.decode( defColorString );
118
119 /** The colorButton component. */
120 private final JButton colorButton =
121 new JButton( COLOR_BUTTON_LABEL );
122 /** The textEditor component. */
123 private final JTextField textEditor =
124 new JTextField( defColorString, 10 );
125 /** The feedback component. */
126 private final JPanel feedback = new JPanel();
127 /** ColorSelector dialog. */
128 +-- 25 lines: private final ColorSelector colorDialog = ---------------------------------------------------------------------------------------------------
153 Font newFont = new Font( name, style, size );
154 textEditor.setFont( newFont );
155
156 feedback.setBackground( defColor );
157 textEditor.addActionListener( e -> editColor() );
158 colorButton.addActionListener( e -> selectColor() );
159
160 feedback.setName( FEEDBACK_NAME );
161 textEditor.setName( TEXT_EDITOR_NAME );
162 colorButton.setName( COLOR_BUTTON_LABEL );
163 }
164
165 /**
166 * Adds a given listener
167 * to the list of ActionListeners
168 * that are notified
169 +--182 lines: * when the selected color changes.-----------------------------------------------------------------------------------------------------------
|