/[svn]/jsampler/trunk/src/org/jsampler/view/fantasia/basic/FantasiaPainter.java
ViewVC logotype

Diff of /jsampler/trunk/src/org/jsampler/view/fantasia/basic/FantasiaPainter.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1817 by iliev, Tue Oct 7 00:07:14 2008 UTC revision 1818 by iliev, Wed Dec 24 17:29:47 2008 UTC
# Line 137  public class FantasiaPainter { Line 137  public class FantasiaPainter {
137          paintOuterBorder (          paintOuterBorder (
138                  Graphics2D g2,                  Graphics2D g2,
139                  double x1, double y1, double x2, double y2,                  double x1, double y1, double x2, double y2,
140                    boolean round, float alphaTop, float alphaLeft, float alphaBottom, float alphaRight
141            ) {
142                    paintOuterBorder (
143                            g2, x1, y1, x2, y2, new RoundCorners(round), 1.0f, 1.0f,
144                            alphaTop, alphaLeft, alphaBottom, alphaRight
145                    );
146            }
147            
148            public static void
149            paintOuterBorder (
150                    Graphics2D g2,
151                    double x1, double y1, double x2, double y2,
152                  RoundCorners rc, float alphaWhite, float alphaBlack                  RoundCorners rc, float alphaWhite, float alphaBlack
153          ) {          ) {
154                    paintOuterBorder (
155                            g2, x1, y1, x2, y2, rc, alphaWhite, alphaBlack,
156                            alphaWhite * 0.40f, alphaWhite * 0.255f, alphaBlack * 0.40f, alphaBlack * 0.20f
157                    );
158            }
159            public static void
160            paintOuterBorder (
161                    Graphics2D g2,
162                    double x1, double y1, double x2, double y2, RoundCorners rc,
163                    float alphaWhite, float alphaBlack,
164                    float alphaTop, float alphaLeft, float alphaBottom, float alphaRight
165            ) {
166                                    
167                  Paint oldPaint = g2.getPaint();                  Paint oldPaint = g2.getPaint();
168                  Composite oldComposite = g2.getComposite();                  Composite oldComposite = g2.getComposite();
169                                    
170                  AlphaComposite ac;                  AlphaComposite ac;
171                  ac = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.40f * alphaWhite);                  ac = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, alphaTop);
172                  g2.setComposite(ac);                  g2.setComposite(ac);
173                                    
174                  double x1t = rc.topLeft ? x1 + 2 : x1;                  double x1t = rc.topLeft ? x1 + 2 : x1;
# Line 194  public class FantasiaPainter { Line 218  public class FantasiaPainter {
218                          g2.draw(l);                          g2.draw(l);
219                  }                  }
220                                    
221                  g2.setComposite(ac.derive(0.255f * alphaWhite));                  g2.setComposite(ac.derive(alphaLeft));
222                                    
223                  l = new Line2D.Double(x1, y1l, x1, y2l);                  l = new Line2D.Double(x1, y1l, x1, y2l);
224                  g2.draw(l);                  g2.draw(l);
225                                    
226                  g2.setComposite(ac.derive(0.40f * alphaBlack));                  g2.setComposite(ac.derive(alphaBottom));
227                  g2.setPaint(Color.BLACK);                  g2.setPaint(Color.BLACK);
228                                    
229                  l = new Line2D.Double(x1b, y2, x2b, y2);                  l = new Line2D.Double(x1b, y2, x2b, y2);
# Line 225  public class FantasiaPainter { Line 249  public class FantasiaPainter {
249                          g2.setPaint(Color.BLACK);                          g2.setPaint(Color.BLACK);
250                  }                  }
251                                    
252                  g2.setComposite(ac.derive(0.20f * alphaBlack));                  g2.setComposite(ac.derive(alphaRight));
253                                    
254                  l = new Line2D.Double(x2, y1r, x2, y2r);                  l = new Line2D.Double(x2, y1r, x2, y2r);
255                  g2.draw(l);                  g2.draw(l);

Legend:
Removed from v.1817  
changed lines
  Added in v.1818

  ViewVC Help
Powered by ViewVC