1 /* BasePainter.java 2 Copyright (C) 2012 Red Hat, Inc. 3 4 This file is part of IcedTea. 5 6 IcedTea is free software; you can redistribute it and/or modify 7 it under the terms of the GNU General Public License as published by 8 the Free Software Foundation; either version 2, or (at your option) 9 any later version. 10 11 IcedTea is distributed in the hope that it will be useful, but 12 WITHOUT ANY WARRANTY; without even the implied warranty of 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 General Public License for more details. 15 16 You should have received a copy of the GNU General Public License 17 along with IcedTea; see the file COPYING. If not, write to the 18 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 19 02110-1301 USA. 20 21 Linking this library statically or dynamically with other modules is 22 making a combined work based on this library. Thus, the terms and 23 conditions of the GNU General Public License cover the whole 24 combination. 25 26 As a special exception, the copyright holders of this library give you 27 permission to link this library with independent modules to produce an 28 executable, regardless of the license terms of these independent 29 modules, and to copy and distribute the resulting executable under 30 terms of your choice, provided that you also meet, for each linked 31 independent module, the terms and conditions of the license of that 32 module. An independent module is a module which is not derived from 33 or based on this library. If you modify this library, you may extend 34 this exception to your version of the library, but you are not 35 obligated to do so. If you do not wish to do so, delete this 36 exception statement from your version. */ 37 package net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012; 38 39 import java.awt.BasicStroke; 40 import net.sourceforge.jnlp.splashscreen.impls.*; 41 import java.awt.Color; 42 import java.awt.Font; 43 import java.awt.FontMetrics; 44 import java.awt.Graphics; 45 import java.awt.Graphics2D; 46 import java.awt.Point; 47 import java.awt.RenderingHints; 48 import java.awt.Stroke; 49 import java.awt.Toolkit; 50 import java.awt.font.TextAttribute; 51 import java.awt.image.BufferedImage; 52 import java.util.HashMap; 53 import java.util.List; 54 55 import java.util.Map; 56 import java.util.Observable; 57 import java.util.Observer; 58 59 import javax.swing.SwingUtilities; 60 import net.sourceforge.jnlp.runtime.Translator; 61 import net.sourceforge.jnlp.splashscreen.SplashUtils.SplashReason; 62 import net.sourceforge.jnlp.splashscreen.parts.BasicComponentSplashScreen; 63 import net.sourceforge.jnlp.splashscreen.parts.InfoItem; 64 import net.sourceforge.jnlp.splashscreen.parts.InformationElement; 65 import net.sourceforge.jnlp.splashscreen.parts.extensions.ExtensionManager; 66 import net.sourceforge.jnlp.util.logging.OutputController; 67 import net.sourceforge.jnlp.util.ScreenFinder; 68 69 public class BasePainter implements Observer { 70 71 protected final BasicComponentSplashScreen master; 72 //animations 73 //waterLevel of water (0-100%) 74 private int waterLevel = 0; 75 //waving of water and position of shhadowed WEB 76 private int animationsPosition = 0; 77 private int greyTextIncrment = 15; //how quickly is greyed web moving 78 //colors 79 protected static final Color TEA_LIVE_COLOR = new Color(205, 1, 3); 80 protected static final Color BACKGROUND_LIVE_COLOR = ExtensionManager.getExtension().getBackground(); 81 protected static final Color TEA_LEAFS_STALKS_LIVE_COLOR = Color.black; 82 protected static final Color PLUGIN_LIVE_COLOR = ExtensionManager.getExtension().getPluginTextColor(); 83 public static final Color WATER_LIVE_COLOR = new Color(80, 131, 160); 84 protected static final Color PLAIN_TEXT_LIVE_COLOR = ExtensionManager.getExtension().getTextColor(); 85 protected Color teaColor; 86 protected Color backgroundColor; 87 protected Color teaLeafsStalksColor; 88 protected Color pluginColor; 89 protected Color waterColor; 90 protected Color plainTextColor; 91 //BufferedImage tmpBackround; //testingBackground for fitting 92 protected BufferedImage prerenderedStuff; 93 private Font teaFont; 94 private Font icedFont; 95 private Font webFont; 96 private Font pluginFont; 97 private Font plainTextsFont; 98 private Font alternativeTextFont; 99 //those spaces are meaningful for centering the text.. thats why alternative;) 100 private static final String alternativeICED = "Iced "; 101 private static final String alternativeWeb = "Web "; 102 private static final String alternativeTtea = " Tea"; 103 private static final String alternativePlugin = "plugin "; 104 private static final String ICED = "Iced"; 105 private static final String web = "web"; 106 private static final String tea = "Tea"; 107 private static final String plugin = "plugin "; 108 //inidivdual sizes, all converging to ZERO!! 109 /** 110 * Experimentaly meassured best top position for painted parts of vectros 111 */ 112 private final int WEB_TOP_ALIGMENT = 324; 113 /** 114 * Experimentaly meassured best left position for painted parts of vectors 115 */ 116 private final int WEB_LEFT_ALIGMENT = 84; 117 //enabling 118 protected boolean showNiceTexts = true; 119 private boolean showLeaf = true; 120 private boolean showInfo = true; 121 protected TextWithWaterLevel twl; 122 protected TextWithWaterLevel oldTwl; 123 protected boolean canWave = true; 124 private Point aboutOfset = new Point(); 125 126 private final static float dash1[] = {10.0f}; 127 private final static BasicStroke dashed = 128 new BasicStroke(1.0f, 129 BasicStroke.CAP_BUTT, 130 BasicStroke.JOIN_MITER, 131 10.0f, dash1, 0.0f); 132 paintNiceTexts(Graphics2D g2d)133 protected void paintNiceTexts(Graphics2D g2d) { 134 //the only animated stuff 135 oldTwl = twl; 136 twl = new TextWithWaterLevel(ICED, icedFont); 137 if (oldTwl != null && !canWave) { 138 twl.setCachedPolygon(oldTwl.getCachedPolygon()); 139 } 140 twl.setPercentageOfWater(waterLevel); 141 twl.setBgColor(backgroundColor); 142 twl.setWaterColor(waterColor); 143 twl.cutTo(g2d, scaleX(42), scaleY(278)); 144 MovingText mt = new MovingText(web, webFont); 145 mt.setPercentageOfWater(animationsPosition); 146 mt.cutTo(g2d, scaleX(WEB_LEFT_ALIGMENT), scaleY(WEB_TOP_ALIGMENT)); 147 } 148 paintPlainTexts(Graphics2D g2d)149 protected void paintPlainTexts(Graphics2D g2d) { 150 g2d.setFont(alternativeTextFont); 151 g2d.setColor(waterColor); 152 drawTextAroundCenter(g2d, -0.6d, alternativeICED); 153 g2d.setColor(teaColor); 154 drawTextAroundCenter(g2d, -0.6d, alternativeTtea); 155 g2d.setColor(pluginColor); 156 String s = getAlternativeProductName(); 157 int sub = animationsPosition / greyTextIncrment; 158 sub = sub % s.length(); 159 if (!master.isAnimationRunning()) { 160 sub = s.length(); 161 } 162 drawTextAroundCenter(g2d, 0.3d, s.substring(0, sub)); 163 } 164 //enabling end 165 scaleAvarage(double origValue)166 private int scaleAvarage(double origValue) { 167 return (int) (avarageRatio() * origValue); 168 } 169 scaleMax(double origValue)170 private int scaleMax(double origValue) { 171 return (int) (maxRatio() * origValue); 172 } 173 scaleMin(double origValue)174 private int scaleMin(double origValue) { 175 return (int) (minRatio() * origValue); 176 } 177 avarageRatio()178 private double avarageRatio() { 179 return (getRatioX() + getRatioY()) / 2d; 180 } 181 minRatio()182 private double minRatio() { 183 return Math.min(getRatioX(), getRatioY()); 184 } 185 maxRatio()186 private double maxRatio() { 187 return Math.max(getRatioX(), getRatioY()); 188 } 189 scaleY(double origValue)190 private int scaleY(double origValue) { 191 return (int) scaleY(master.getSplashHeight(), origValue); 192 } 193 scaleX(double origValue)194 private int scaleX(double origValue) { 195 return (int) scaleX(master.getSplashWidth(), origValue); 196 } 197 getRatioY()198 private double getRatioY() { 199 return getRatio(DefaultSplashScreen2012.ORIGINAL_H, master.getSplashHeight()); 200 } 201 getRatioX()202 private double getRatioX() { 203 return getRatio(DefaultSplashScreen2012.ORIGINAL_W, master.getSplashWidth()); 204 } 205 scaleY(double currentSize, double origValue)206 private static double scaleY(double currentSize, double origValue) { 207 return scale(DefaultSplashScreen2012.ORIGINAL_H, currentSize, origValue); 208 } 209 scaleX(double currentSize, double origValue)210 private static double scaleX(double currentSize, double origValue) { 211 return scale(DefaultSplashScreen2012.ORIGINAL_W, currentSize, origValue); 212 } 213 getRatioY(double currentSize)214 private static double getRatioY(double currentSize) { 215 return getRatio(DefaultSplashScreen2012.ORIGINAL_H, currentSize); 216 } 217 getRatioX(double currentSize)218 private static double getRatioX(double currentSize) { 219 return getRatio(DefaultSplashScreen2012.ORIGINAL_W, currentSize); 220 } 221 scale(double origSize, double currentSize, double origValue)222 public static double scale(double origSize, double currentSize, double origValue) { 223 return getRatio(origSize, currentSize) * origValue; 224 } 225 getRatio(double origSize, double currentSize)226 public static double getRatio(double origSize, double currentSize) { 227 return (currentSize / origSize); 228 } 229 //size is considered from 0-origsize as 0-1. 230 231 //scaling end BasePainter(BasicComponentSplashScreen master)232 public BasePainter(BasicComponentSplashScreen master) { 233 this(master, false); 234 } 235 BasePainter(BasicComponentSplashScreen master, boolean startAnimation)236 public BasePainter(BasicComponentSplashScreen master, boolean startAnimation) { 237 //to have this in inner classes 238 this.master = master; 239 setColors(); 240 adjustForSize(master.getSplashWidth(), master.getSplashHeight()); 241 ExtensionManager.getExtension().adjustForSize(master.getSplashWidth(), master.getSplashHeight()); 242 if (startAnimation) { 243 startAnimationThreads(); 244 } 245 246 } 247 increaseAnimationPosition()248 public void increaseAnimationPosition() { 249 ExtensionManager.getExtension().animate(); 250 animationsPosition += greyTextIncrment; 251 } 252 ensurePrerenderedStuff()253 protected void ensurePrerenderedStuff() { 254 if (this.prerenderedStuff == null) { 255 this.prerenderedStuff = prerenderStill(); 256 } 257 } 258 paint(Graphics g)259 public void paint(Graphics g) { 260 Graphics2D g2d = (Graphics2D) g; 261 ensurePrerenderedStuff(); 262 if (prerenderedStuff != null) { 263 g2d.drawImage(prerenderedStuff, 0, 0, null); 264 } 265 266 if (showNiceTexts) { 267 ExtensionManager.getExtension().paint(g, this); 268 paintNiceTexts(g2d); 269 } else { 270 paintPlainTexts(g2d); 271 } 272 273 274 275 } 276 adjustForSize(int width, int height)277 public final void adjustForSize(int width, int height) { 278 prepareFonts(width, height); 279 //enablings depends on fonts 280 setEnablings(width, height, master.getVersion(), master.getInformationElement(), (Graphics2D) (master.getGraphics())); 281 prerenderedStuff = prerenderStill(); 282 ExtensionManager.getExtension().adjustForSize(width, height); 283 } 284 setEnablings(int w, int h, String version, InformationElement ic, Graphics2D g2d)285 private void setEnablings(int w, int h, String version, InformationElement ic, Graphics2D g2d) { 286 showLeaf = true; 287 if (w > 0 && h > 0) { 288 //leaf stretch much better to wide then to high 289 if (h / w > 2 || w / h > 6) { 290 showLeaf = false; 291 } 292 } 293 showInfo = true; 294 if (version != null && g2d != null && ic != null && ic.getHeader() != null && ic.getHeader().size() > 0) { 295 String s = ic.getHeader().get(0); 296 FontMetrics fm = g2d.getFontMetrics(plainTextsFont); 297 int versionLength = fm.stringWidth(version); 298 int firsDescLineLengthg = fm.stringWidth(s); 299 if (firsDescLineLengthg > w - versionLength - 10) { 300 showInfo = false; 301 } 302 } 303 if (Math.min(h, w) < ScreenFinder.getCurrentScreenSizeWithoutBounds().getHeight() / 10) { 304 showNiceTexts = false; 305 } else { 306 showNiceTexts = true; 307 } 308 } 309 startAnimationThreads()310 public final void startAnimationThreads() { 311 Thread tt = getMovingTextThread(); 312 tt.start(); 313 Thread t = getWaterLevelThread(); 314 t.start(); 315 } 316 prepareFonts(int w, int h)317 private void prepareFonts(int w, int h) { 318 master.setSplashHeight(h); 319 master.setSplashWidth(w); 320 Map<TextAttribute, Object> teaFontAttributes = new HashMap<TextAttribute, Object>(); 321 teaFontAttributes.put(TextAttribute.SIZE, new Integer(scaleMin(84))); 322 teaFontAttributes.put(TextAttribute.WIDTH, new Double((0.95))); 323 teaFontAttributes.put(TextAttribute.FAMILY, "Serif"); 324 teaFont = new Font(teaFontAttributes); 325 Map<TextAttribute, Object> icedFontAttributes = new HashMap<TextAttribute, Object>(); 326 icedFontAttributes.put(TextAttribute.SIZE, new Integer(scaleMin(82))); 327 icedFontAttributes.put(TextAttribute.WIDTH, new Double((0.80))); 328 icedFontAttributes.put(TextAttribute.FAMILY, "Serif"); 329 icedFont = new Font(icedFontAttributes); 330 Map<TextAttribute, Object> webFontAttributes = new HashMap<TextAttribute, Object>(); 331 webFontAttributes.put(TextAttribute.SIZE, new Integer(scaleMin(41))); 332 webFontAttributes.put(TextAttribute.WIDTH, new Double((2))); 333 webFontAttributes.put(TextAttribute.FAMILY, "Serif"); 334 webFont = new Font(webFontAttributes); 335 Map<TextAttribute, Object> pluginFontAttributes = new HashMap<TextAttribute, Object>(); 336 pluginFontAttributes.put(TextAttribute.SIZE, new Integer(scaleMin(32))); 337 pluginFontAttributes.put(TextAttribute.WEIGHT, new Double((5d))); 338 pluginFontAttributes.put(TextAttribute.WIDTH, new Double((0.9))); 339 pluginFontAttributes.put(TextAttribute.FAMILY, "Serif"); 340 pluginFont = new Font(pluginFontAttributes); 341 Map<TextAttribute, Object> plainFontAttributes = new HashMap<TextAttribute, Object>(); 342 plainFontAttributes.put(TextAttribute.SIZE, new Integer(12)); 343 plainFontAttributes.put(TextAttribute.FAMILY, "Monospaced"); 344 plainTextsFont = new Font(plainFontAttributes); 345 Map<TextAttribute, Object> alternativeTextFontAttributes = new HashMap<TextAttribute, Object>(); 346 alternativeTextFontAttributes.put(TextAttribute.SIZE, Math.min(w, h) / 5); 347 alternativeTextFontAttributes.put(TextAttribute.WIDTH, new Double((0.7))); 348 alternativeTextFontAttributes.put(TextAttribute.FAMILY, "Monospaced"); 349 alternativeTextFont = new Font(alternativeTextFontAttributes); 350 351 } 352 setColors()353 private void setColors() { 354 355 teaColor = TEA_LIVE_COLOR; 356 backgroundColor = BACKGROUND_LIVE_COLOR; 357 teaLeafsStalksColor = TEA_LEAFS_STALKS_LIVE_COLOR; 358 pluginColor = PLUGIN_LIVE_COLOR; 359 waterColor = WATER_LIVE_COLOR; 360 plainTextColor = PLAIN_TEXT_LIVE_COLOR; 361 362 } 363 prerenderStill()364 protected BufferedImage prerenderStill() { 365 if (master.getSplashWidth() <= 0 || master.getSplashHeight() <= 0) { 366 return null; 367 } 368 BufferedImage bi = new BufferedImage(master.getSplashWidth(), master.getSplashHeight(), BufferedImage.TYPE_INT_ARGB); 369 paintStillTo(bi.createGraphics(), master.getInformationElement(), master.getVersion()); 370 return bi; 371 } 372 paintStillTo(Graphics2D g2d, InformationElement ic, String version)373 protected void paintStillTo(Graphics2D g2d, InformationElement ic, String version) { 374 RenderingHints r = g2d.getRenderingHints(); 375 drawBase(g2d, ic, version); 376 g2d.setRenderingHints(r); 377 } 378 drawTextAroundCenter(Graphics2D g2d, double heightOffset, String msg)379 protected void drawTextAroundCenter(Graphics2D g2d, double heightOffset, String msg) { 380 381 int y = (master.getSplashHeight() / 2) + (g2d.getFontMetrics().getHeight() / 2 + (int) (heightOffset * g2d.getFontMetrics().getHeight())); 382 int x = (master.getSplashWidth() / 2) - (g2d.getFontMetrics().stringWidth(msg) / 2); 383 g2d.drawString(msg, x, y); 384 } 385 getMovingTextThread()386 private Thread getMovingTextThread() { 387 Thread tt = new Thread(new MovingTextRunner(this)); 388 //tt.setDaemon(true); 389 return tt; 390 } 391 stripCommitFromVersion(String version)392 static String stripCommitFromVersion(String version) { 393 if (version.contains("pre+")) { 394 return version; 395 } 396 int i = version.indexOf("+"); 397 if (i < 0) { 398 return version; 399 } 400 return version.substring(0, version.indexOf("+")); 401 } 402 403 private final class MovingTextRunner extends Observable implements Runnable { 404 405 private static final int MAX_ANIMATION_VALUE = 10000; 406 private static final int ANIMATION_RESTART_VALUE = 1; 407 private static final long MOOVING_TEXT_DELAY = 150; 408 MovingTextRunner(Observer o)409 public MovingTextRunner(Observer o) { 410 this.addObserver(o); 411 } 412 413 @Override run()414 public void run() { 415 while (master.isAnimationRunning()) { 416 try { 417 animationsPosition += greyTextIncrment; 418 if (animationsPosition > MAX_ANIMATION_VALUE) { 419 animationsPosition = ANIMATION_RESTART_VALUE; 420 } 421 this.setChanged(); 422 this.notifyObservers(); 423 Thread.sleep(MOOVING_TEXT_DELAY); 424 } catch (Exception e) { 425 OutputController.getLogger().log(e); 426 } 427 } 428 } 429 }; 430 getWaterLevelThread()431 private Thread getWaterLevelThread() { 432 Thread t = new Thread(new WaterLevelThread(this)); 433 //t.setDaemon(true); 434 return t; 435 } 436 437 private final class WaterLevelThread extends Observable implements Runnable { 438 439 private static final int MAX_WATERLEVEL_VALUE = 120; 440 private static final int WATER_LEVEL_INCREMENT = 2; 441 WaterLevelThread(BasePainter o)442 private WaterLevelThread(BasePainter o) { 443 this.addObserver(o); 444 } 445 446 @Override run()447 public void run() { 448 while (master.isAnimationRunning()) { 449 if (waterLevel > MAX_WATERLEVEL_VALUE) { 450 break; 451 } 452 try { 453 waterLevel += WATER_LEVEL_INCREMENT; 454 this.setChanged(); 455 this.notifyObservers(); 456 //it is risinfg slower and slower 457 Thread.sleep((waterLevel / 4) * 30); 458 } catch (Exception e) { 459 OutputController.getLogger().log(e); 460 } 461 } 462 } 463 }; 464 getAlternativeProductName()465 private String getAlternativeProductName() { 466 if (SplashReason.JAVAWS.equals(master.getSplashReason())) { 467 return alternativeWeb; 468 } else if (SplashReason.APPLET.equals(master.getSplashReason())) { 469 return alternativeWeb + alternativePlugin; 470 } else { 471 return "...."; 472 } 473 } 474 drawBase(Graphics2D g2d, InformationElement ic, String version)475 protected FontMetrics drawBase(Graphics2D g2d, InformationElement ic, String version) { 476 g2d.setColor(backgroundColor); 477 g2d.fillRect(0, 0, master.getSplashWidth() + 5, master.getSplashHeight() + 5); 478 if (showNiceTexts) { 479 //g2d.drawImage(tmpBackround, 0, 0, null); 480 g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); 481 g2d.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY); 482 g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON); 483 g2d.setFont(teaFont); 484 g2d.setColor(teaColor); 485 g2d.drawString(tea, scaleX(42) + g2d.getFontMetrics(icedFont).stringWidth(ICED), scaleY(278)); 486 g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_OFF); 487 if (showLeaf) { 488 g2d.fillPolygon(SplinesDefs.getMainLeafCurve(getRatioX(), getRatioY())); 489 } 490 if (showLeaf) { 491 g2d.fillPolygon(SplinesDefs.getSecondLeafCurve(getRatioX(), getRatioY())); 492 } 493 g2d.setColor(teaLeafsStalksColor); 494 if (showLeaf) { 495 g2d.fillPolygon(SplinesDefs.getMainLeafStalkCurve(getRatioX(), getRatioY())); 496 } 497 if (showLeaf) { 498 g2d.fillPolygon(SplinesDefs.getSecondLeafStalkCurve(getRatioX(), getRatioY())); 499 } 500 g2d.setFont(pluginFont); 501 g2d.setColor(pluginColor); 502 if (SplashReason.APPLET.equals(master.getSplashReason())) { 503 if (showLeaf) { 504 g2d.drawString(plugin, scaleX(404), scaleY(145)); 505 } else { 506 FontMetrics wfm = g2d.getFontMetrics(webFont); 507 g2d.drawString(plugin, wfm.stringWidth(web) + scaleX(WEB_LEFT_ALIGMENT) + 10, scaleY(WEB_TOP_ALIGMENT)); 508 } 509 } 510 g2d.setFont(plainTextsFont); 511 g2d.setColor(plainTextColor); 512 FontMetrics fm = g2d.getFontMetrics(); 513 if (ic != null) { 514 InfoItem des = ic.getBestMatchingDescriptionForSplash(); 515 List<String> head = ic.getHeader(); 516 if (head != null && showInfo) { 517 for (int i = 0; i < head.size(); i++) { 518 String string = head.get(i); 519 g2d.drawString(string, 5, (i + 1) * fm.getHeight()); 520 } 521 } 522 if (des != null && des.getValue() != null) { 523 g2d.drawString(des.getValue(), 5, master.getSplashHeight() - fm.getHeight()); 524 } 525 } 526 } 527 g2d.setFont(plainTextsFont); 528 g2d.setColor(plainTextColor); 529 FontMetrics fm = g2d.getFontMetrics(); 530 if (version != null) { 531 String aboutPrefix = Translator.R("AboutDialogueTabAbout") + ": "; 532 int aboutPrefixWidth = fm.stringWidth(aboutPrefix); 533 String niceVersion = stripCommitFromVersion(version); 534 int y = master.getSplashWidth() - fm.stringWidth(niceVersion + " "); 535 if (y < 0) { 536 y = 0; 537 } 538 if (y > aboutPrefixWidth) { 539 niceVersion = aboutPrefix + niceVersion; 540 y -= aboutPrefixWidth; 541 } 542 aboutOfset = new Point(y, fm.getHeight()); 543 Stroke backup = g2d.getStroke(); 544 g2d.setStroke(dashed); 545 g2d.drawRect(aboutOfset.x-1,1, master.getSplashWidth()-aboutOfset.x-1, aboutOfset.y+1); 546 g2d.setStroke(backup); 547 g2d.drawString(niceVersion, y, fm.getHeight()); 548 } 549 return fm; 550 } 551 getWaterLevel()552 public int getWaterLevel() { 553 return waterLevel; 554 } 555 setWaterLevel(int level)556 public void setWaterLevel(int level) { 557 this.waterLevel = level; 558 } 559 getAnimationsPosition()560 public int getAnimationsPosition() { 561 return animationsPosition; 562 } 563 clearCachedWaterTextImage()564 public void clearCachedWaterTextImage() { 565 oldTwl = null; 566 } 567 568 @Override update(Observable o, Object arg)569 public void update(Observable o, Object arg) { 570 try { 571 SwingUtilities.invokeAndWait(new Runnable() { 572 573 @Override 574 public void run() { 575 ExtensionManager.getExtension().animate(); 576 master.repaint(); 577 } 578 }); 579 } catch (Exception ex) { 580 OutputController.getLogger().log(ex); 581 } 582 } 583 getMaster()584 public BasicComponentSplashScreen getMaster() { 585 return master; 586 } 587 getAboutOfset()588 public Point getAboutOfset() { 589 return aboutOfset; 590 } 591 getWaterColor()592 public Color getWaterColor() { 593 return waterColor; 594 } 595 getBackgroundColor()596 public Color getBackgroundColor() { 597 return backgroundColor; 598 } 599 600 } 601