From: <k_s...@us...> - 2008-09-27 10:34:10
|
Revision: 13809 http://jedit.svn.sourceforge.net/jedit/?rev=13809&view=rev Author: k_satoda Date: 2008-09-27 10:34:07 +0000 (Sat, 27 Sep 2008) Log Message: ----------- Made the iconPosition initialized also at startup. Modified Paths: -------------- plugins/Background/trunk/background/BackgroundHighlight.java Modified: plugins/Background/trunk/background/BackgroundHighlight.java =================================================================== --- plugins/Background/trunk/background/BackgroundHighlight.java 2008-09-27 10:28:27 UTC (rev 13808) +++ plugins/Background/trunk/background/BackgroundHighlight.java 2008-09-27 10:34:07 UTC (rev 13809) @@ -46,6 +46,16 @@ private static final int ICON_CENTER = 0; private static final int ICON_STRECH = 1; private static final int ICON_TILE = 2; + private static int getIconPositionFromString(String s) { + for (int i =0 ; i < BackgroundOptionPane.IMAGE_POSITIONS.length; i++) + { + if (BackgroundOptionPane.IMAGE_POSITIONS[i].equals(s)) + { + return i; + } + } + return ICON_TILE; + } // (EditPane, BackgroundHighlight) association private static Hashtable highlights = new Hashtable(); @@ -81,6 +91,8 @@ icon = null; Log.log(Log.DEBUG, BackgroundHighlight.class, e); } + iconPosition = getIconPositionFromString( + jEdit.getProperty("background.position", "tile")); blend = jEdit.getBooleanProperty("background.blend", false); blendColor = jEdit.getColorProperty( @@ -267,16 +279,8 @@ iconName = newIconName; icon = newIcon; - - String position = jEdit.getProperty("background.position", "tile"); - for (int i =0 ; i < BackgroundOptionPane.IMAGE_POSITIONS.length; i++) - { - if (BackgroundOptionPane.IMAGE_POSITIONS[i].equals(position)) - { - iconPosition = i; - break; - } - } + iconPosition = getIconPositionFromString( + jEdit.getProperty("background.position", "tile")); blend = jEdit.getBooleanProperty("background.blend", false); blendColor = jEdit.getColorProperty( This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |