DateLayer Problems

From: Stephanie Piet <spiet@optimetrics.org>
Date: Mon Jul 15 2002 - 15:20:34 EDT

Hi Everyone,

I've been recently working on a layer that extends off of DateLayer.java. What I'm trying to do is change the foreground and background colors once the DateLayer is turned on. I've created a GUI in which you can select which colors you want for the background/foreground. Now the code for the foreground color works just fine, but I seem to be having trouble with the background color and getting it to draw on the map. Here's some of the code below. I'm fairly new to OpenMap/Java, I would appreciate any input/suggestions.

/********************************************************************//
//**** Set up color chooser for setting Background color ****//
//******************************************************************//
             bcc.addActionListener(
                 new ActionListener() {
                     public void actionPerformed(ActionEvent e) {
                         Color newColor = JColorChooser.showDialog(
                                                     RPMDateLayer.this,
                                                    "Choose Background Color",
                                                     sample.getBackground());

                        if (newColor != null) {
                             sample.setBackground(newColor);

        /**Implements the Background Color**/

                             bgColor = newColor;
                             setLabelText(sample.getText());
                             text.setShowBounds(true);
                             text.setBoundsLineColor(bgColor);
                             text.setBoundsFillColor(bgColor);
                             text.generate(getProjection());
                             repaint();
                                            }
                                    }
                             });

/*******************************************************************//
//**** Set up color chooser for setting Foreground color ****//
//*****************************************************************//

             bcc1.addActionListener(
                 new ActionListener()
                 {
                     public void actionPerformed(ActionEvent e)
                     {
                         Color newColor = JColorChooser.showDialog(
                                                     RPMDateLayer.this,
                                                     "Choose Foreground Color",
                                                     sample.getForeground());

                         if (newColor != null)
                         {
                             sample.setForeground(newColor);

                            /**Implements the Foreground Color**/

                             fgColor = newColor;
                             text.setLinePaint(fgColor);
                         }
                      }
                  });

Thanks!

**********************
Stephanie K. Piet
OptiMetrics, Inc.
2107 Laurel Bush Rd. Suite 209
Bel Air, MD 21015
SPiet@OptiMetrics.org
http://www.OptiMetrics.org
(410)569-6081 ext: 111
fax: (410)569-6083

--
[To unsubscribe to this list send an email to "majdart@bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Mon Jul 15 15:21:03 2002

This archive was generated by hypermail 2.1.8 : Thu May 12 2005 - 07:18:33 EDT