From: <k_s...@us...> - 2008-09-27 11:42:09
|
Revision: 13813 http://jedit.svn.sourceforge.net/jedit/?rev=13813&view=rev Author: k_satoda Date: 2008-09-27 11:42:01 +0000 (Sat, 27 Sep 2008) Log Message: ----------- Fixed some inconsistent whitespace styles. Modified Paths: -------------- plugins/Background/trunk/background/BackgroundHighlight.java plugins/Background/trunk/background/BackgroundOptionPane.java plugins/Background/trunk/background/BackgroundPlugin.java Modified: plugins/Background/trunk/background/BackgroundHighlight.java =================================================================== --- plugins/Background/trunk/background/BackgroundHighlight.java 2008-09-27 11:19:29 UTC (rev 13812) +++ plugins/Background/trunk/background/BackgroundHighlight.java 2008-09-27 11:42:01 UTC (rev 13813) @@ -48,12 +48,10 @@ 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; - } + for (int i =0 ; i < BackgroundOptionPane.IMAGE_POSITIONS.length; i++) { + if (BackgroundOptionPane.IMAGE_POSITIONS[i].equals(s)) { + return i; + } } return ICON_TILE; } @@ -131,9 +129,8 @@ int lastLine, int[] physicalLines, int[] start, int[] end, int lineY, int lineHeight ) { - if (!isEnabled() || icon == null || icon.getImageLoadStatus() != MediaTracker.COMPLETE) - { - return; + if (!isEnabled() || icon == null || icon.getImageLoadStatus() != MediaTracker.COMPLETE) { + return; } TextAreaPainter painter = this.textArea.getPainter(); @@ -145,34 +142,31 @@ Rectangle rect = gfx.getClipBounds(); - if (iconPosition == ICON_TILE) - { - int x0 = rect.x; - int x1 = x0 + rect.width; - int y0 = rect.y; - int y1 = y0 + rect.height; - for (int x = 0; x <= x1; x += iconWidth) { - if (x + iconWidth > x0) { - for (int y = 0; y <= y1; y += iconHeight) { - if (y + iconHeight > y0) { - gfx.drawImage(iconImage, x, y, textArea); + if (iconPosition == ICON_TILE) { + int x0 = rect.x; + int x1 = x0 + rect.width; + int y0 = rect.y; + int y1 = y0 + rect.height; + for (int x = 0; x <= x1; x += iconWidth) { + if (x + iconWidth > x0) { + for (int y = 0; y <= y1; y += iconHeight) { + if (y + iconHeight > y0) { + gfx.drawImage(iconImage, x, y, textArea); + } + } } - } } - } } - else if (iconPosition == ICON_STRECH) - { - gfx.drawImage(iconImage, - 0, 0, painterWidth, painterHeight, - textArea); + else if (iconPosition == ICON_STRECH) { + gfx.drawImage(iconImage, + 0, 0, painterWidth, painterHeight, + textArea); } - else if (iconPosition == ICON_CENTER) - { - gfx.drawImage(iconImage, - (painterWidth - iconWidth) / 2, - (painterHeight - iconHeight) / 2, - textArea); + else if (iconPosition == ICON_CENTER) { + gfx.drawImage(iconImage, + (painterWidth - iconWidth) / 2, + (painterHeight - iconHeight) / 2, + textArea); } if (blend) { Modified: plugins/Background/trunk/background/BackgroundOptionPane.java =================================================================== --- plugins/Background/trunk/background/BackgroundOptionPane.java 2008-09-27 11:19:29 UTC (rev 13812) +++ plugins/Background/trunk/background/BackgroundOptionPane.java 2008-09-27 11:42:01 UTC (rev 13813) @@ -61,12 +61,15 @@ static String[] POSITION_LABELS = new String[IMAGE_POSITIONS.length]; static { - for (int i =0 ; i < IMAGE_POSITIONS.length; i++) - { - POSITION_LABELS[i] = - jEdit.getProperty("options.background.image-" + IMAGE_POSITIONS[i], IMAGE_POSITIONS[i]); - } + for (int i =0 ; i < IMAGE_POSITIONS.length; i++) { + POSITION_LABELS[i] = jEdit.getProperty( + "options.background.image-" + IMAGE_POSITIONS[i], + IMAGE_POSITIONS[i] + ); + } } + + public BackgroundOptionPane() { super("background"); } @@ -93,15 +96,15 @@ imagePosition = new JComboBox(POSITION_LABELS); String position = jEdit.getProperty("background.position", "tile"); - for (int i =0 ; i < IMAGE_POSITIONS.length; i++) - { - if (position.equals(IMAGE_POSITIONS[i])) - { - imagePosition.setSelectedIndex(i); - } + for (int i =0 ; i < IMAGE_POSITIONS.length; i++) { + if (position.equals(IMAGE_POSITIONS[i])) { + imagePosition.setSelectedIndex(i); + } } addComponent( - jEdit.getProperty("options.background.image-position"), imagePosition); + jEdit.getProperty("options.background.image-position"), + imagePosition + ); this.blend = new JCheckBox( jEdit.getProperty("options.background.blend"), @@ -165,7 +168,9 @@ ); jEdit.setProperty( - "background.position", IMAGE_POSITIONS[imagePosition.getSelectedIndex()]); + "background.position", + IMAGE_POSITIONS[imagePosition.getSelectedIndex()] + ); } Modified: plugins/Background/trunk/background/BackgroundPlugin.java =================================================================== --- plugins/Background/trunk/background/BackgroundPlugin.java 2008-09-27 11:19:29 UTC (rev 13812) +++ plugins/Background/trunk/background/BackgroundPlugin.java 2008-09-27 11:42:01 UTC (rev 13813) @@ -28,38 +28,33 @@ public class BackgroundPlugin extends EBPlugin { - public void start() - { - View view = jEdit.getFirstView(); - while (view != null) - { - EditPane[] panes = view.getEditPanes(); - for (int i = 0; i < panes.length; i++) - initEditPane(panes[i]); - view = view.getNext(); - } + public void start() { + View view = jEdit.getFirstView(); + while (view != null) { + EditPane[] panes = view.getEditPanes(); + for (int i = 0; i < panes.length; i++) + initEditPane(panes[i]); + view = view.getNext(); + } } - - - public void stop() - { - View view = jEdit.getFirstView(); - while (view != null) - { - EditPane[] panes = view.getEditPanes(); - for (int i = 0; i < panes.length; i++) - uninitEditPane(panes[i]); - view = view.getNext(); - } + + public void stop() { + View view = jEdit.getFirstView(); + while (view != null) { + EditPane[] panes = view.getEditPanes(); + for (int i = 0; i < panes.length; i++) + uninitEditPane(panes[i]); + view = view.getNext(); + } } - + public void handleMessage(EBMessage message) { if (message instanceof EditPaneUpdate) { EditPaneUpdate epu = (EditPaneUpdate) message; EditPane editPane = epu.getEditPane(); - + if (epu.getWhat() == EditPaneUpdate.CREATED) { - initEditPane(editPane); + initEditPane(editPane); } else if (epu.getWhat() == EditPaneUpdate.DESTROYED) { uninitEditPane(editPane); } @@ -67,26 +62,24 @@ BackgroundHighlight.propertiesChanged(); } } - - private static void initEditPane(EditPane editPane) - { - TextAreaPainter textAreaPainter = editPane.getTextArea().getPainter(); - - BackgroundHighlight backgroundHighlight = - (BackgroundHighlight) BackgroundHighlight.addHighlightTo(editPane); - - textAreaPainter.addExtension(TextAreaPainter.BACKGROUND_LAYER, backgroundHighlight); - } - - private static void uninitEditPane(EditPane editPane) - { - TextAreaPainter textAreaPainter = editPane.getTextArea().getPainter(); - - BackgroundHighlight backgroundHighlight = - BackgroundHighlight.getHighlightFor(editPane); - - textAreaPainter.removeExtension(backgroundHighlight); - BackgroundHighlight.removeHighlightFrom(editPane); - } + + private static void initEditPane(EditPane editPane) { + TextAreaPainter textAreaPainter = editPane.getTextArea().getPainter(); + + BackgroundHighlight backgroundHighlight = + (BackgroundHighlight) BackgroundHighlight.addHighlightTo(editPane); + + textAreaPainter.addExtension(TextAreaPainter.BACKGROUND_LAYER, backgroundHighlight); + } + + private static void uninitEditPane(EditPane editPane) { + TextAreaPainter textAreaPainter = editPane.getTextArea().getPainter(); + + BackgroundHighlight backgroundHighlight = + BackgroundHighlight.getHighlightFor(editPane); + + textAreaPainter.removeExtension(backgroundHighlight); + BackgroundHighlight.removeHighlightFrom(editPane); + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |