You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by sm...@apache.org on 2013/10/05 01:45:53 UTC
svn commit: r1529349 [10/44] - in /pivot/trunk:
charts/src/org/apache/pivot/charts/
charts/src/org/apache/pivot/charts/skin/ core/src/org/apache/pivot/beans/
core/src/org/apache/pivot/collections/
core/src/org/apache/pivot/collections/adapter/ core/src...
Modified: pivot/trunk/tests/src/org/apache/pivot/tests/issues/pivot859/Pivot859.java
URL: http://svn.apache.org/viewvc/pivot/trunk/tests/src/org/apache/pivot/tests/issues/pivot859/Pivot859.java?rev=1529349&r1=1529348&r2=1529349&view=diff
==============================================================================
--- pivot/trunk/tests/src/org/apache/pivot/tests/issues/pivot859/Pivot859.java (original)
+++ pivot/trunk/tests/src/org/apache/pivot/tests/issues/pivot859/Pivot859.java Fri Oct 4 23:45:40 2013
@@ -50,7 +50,6 @@ public class Pivot859 extends Applicatio
private String appletName = null;
private String defaultURL = null;
-
@Override
public void startup(final Display display, Map<String, String> properties) throws Exception {
System.out.println("startup(...)");
@@ -73,9 +72,8 @@ public class Pivot859 extends Applicatio
}
/**
- * Set the Applet name.
- * <p>
- * Called by JavaScript from the Browser.
+ * Set the Applet name. <p> Called by JavaScript from the Browser.
+ *
* @param name the name
*/
public void setAppletName(String name) {
@@ -84,22 +82,20 @@ public class Pivot859 extends Applicatio
}
/**
- * Get the Applet name.
- * <p>
- * Called by JavaScript from the Browser.
+ * Get the Applet name. <p> Called by JavaScript from the Browser.
+ *
* @return the name
*/
public String getAppletName() {
return appletName;
}
-
private void initializeProperties(Map<String, String> properties) {
defaultURL = properties.get("default_url");
- if (defaultURL == null){
+ if (defaultURL == null) {
defaultURL = "";
}
- if (defaultURL.length() > 0){
+ if (defaultURL.length() > 0) {
System.out.println("got default URL from startup properties, to \"" + defaultURL + "\"");
}
}
@@ -107,12 +103,12 @@ public class Pivot859 extends Applicatio
private void initializeFields(BXMLSerializer serializer) {
System.out.println("initializeFields: start");
- urlInput = (TextInput)serializer.getNamespace().get("textInput");
- if (defaultURL.length() > 0){
+ urlInput = (TextInput) serializer.getNamespace().get("textInput");
+ if (defaultURL.length() > 0) {
urlInput.setText(defaultURL);
}
- goButton = (PushButton)serializer.getNamespace().get("goButton");
+ goButton = (PushButton) serializer.getNamespace().get("goButton");
goButton.getButtonPressListeners().add(new ButtonPressListener() {
@Override
public void buttonPressed(Button button) {
@@ -121,8 +117,8 @@ public class Pivot859 extends Applicatio
}
});
- contentArea = (TextArea)serializer.getNamespace().get("textArea");
- clearButton = (PushButton)serializer.getNamespace().get("clearButton");
+ contentArea = (TextArea) serializer.getNamespace().get("textArea");
+ clearButton = (PushButton) serializer.getNamespace().get("clearButton");
clearButton.getButtonPressListeners().add(new ButtonPressListener() {
@Override
public void buttonPressed(Button button) {
@@ -130,13 +126,13 @@ public class Pivot859 extends Applicatio
}
});
- statusLabel = (Label)serializer.getNamespace().get("textStatus");
+ statusLabel = (Label) serializer.getNamespace().get("textStatus");
System.out.println("initializeFields: end");
}
private String getAppletNameForLog() {
- return ( (getAppletName() != null) ? getAppletName() + ": " : "" );
+ return ((getAppletName() != null) ? getAppletName() + ": " : "");
}
private void updateStatus(String status) {
@@ -164,13 +160,14 @@ public class Pivot859 extends Applicatio
}
/**
- * Retrieve content from the given URL (in applet GUI), but in a synchronous way.
+ * Retrieve content from the given URL (in applet GUI), but in a synchronous
+ * way.
*/
private void retrieveURLContentSync() {
URL url = buildURL();
if (url == null) {
updateStatus("Unable to retrieve content from a bad URL");
- return ;
+ return;
}
try {
@@ -181,7 +178,7 @@ public class Pivot859 extends Applicatio
@SuppressWarnings("resource")
InputStream inputStream = url.openStream();
String result = serializer.readObject(inputStream);
- if (result == null){
+ if (result == null) {
result = "";
}
long end = System.currentTimeMillis();
@@ -193,8 +190,8 @@ public class Pivot859 extends Applicatio
}
}
-// TODO: retrieve content in the usual asynchronous way, but maybe in another method ...
-
+ // TODO: retrieve content in the usual asynchronous way, but maybe in
+ // another method ...
public static void main(String[] args) {
DesktopApplicationContext.main(Pivot859.class, args);
Modified: pivot/trunk/tests/src/org/apache/pivot/tests/issues/pivot861/LeakTestWindow.java
URL: http://svn.apache.org/viewvc/pivot/trunk/tests/src/org/apache/pivot/tests/issues/pivot861/LeakTestWindow.java?rev=1529349&r1=1529348&r2=1529349&view=diff
==============================================================================
--- pivot/trunk/tests/src/org/apache/pivot/tests/issues/pivot861/LeakTestWindow.java (original)
+++ pivot/trunk/tests/src/org/apache/pivot/tests/issues/pivot861/LeakTestWindow.java Fri Oct 4 23:45:40 2013
@@ -35,16 +35,12 @@ import org.apache.pivot.wtk.Window;
/**
* Simple test window which continuously presses a button which opens a dialog
- * box and then closes it immediately.
- *
- * Watch the heap usage in a profiler and compare:
- * - when TestDialog has an icon (specified in ok_dialog.bxml)
- * - when TestDialog has no icon
- * and see that heap usage will grow to almost the maximum when an icon is used
- * in TestDialog.
- *
- * The icon contains an ImageListenerList which will retain a
- * reference to every dialog created, thus preventing them being garbage collected.
+ * box and then closes it immediately. Watch the heap usage in a profiler and
+ * compare: - when TestDialog has an icon (specified in ok_dialog.bxml) - when
+ * TestDialog has no icon and see that heap usage will grow to almost the
+ * maximum when an icon is used in TestDialog. The icon contains an
+ * ImageListenerList which will retain a reference to every dialog created, thus
+ * preventing them being garbage collected.
*/
public class LeakTestWindow extends Window implements Bindable {
@@ -90,11 +86,11 @@ public class LeakTestWindow extends Wind
ApplicationContext.scheduleCallback(new Runnable() {
@Override
public void run() {
- while(true) {
+ while (true) {
button.press();
}
}
- }, 1000 // add a little delay (instead of 0) to show the TestDialog
+ }, 1000 // add a little delay (instead of 0) to show the TestDialog
);
}
Modified: pivot/trunk/tests/src/org/apache/pivot/tests/issues/pivot861/Pivot861.java
URL: http://svn.apache.org/viewvc/pivot/trunk/tests/src/org/apache/pivot/tests/issues/pivot861/Pivot861.java?rev=1529349&r1=1529348&r2=1529349&view=diff
==============================================================================
--- pivot/trunk/tests/src/org/apache/pivot/tests/issues/pivot861/Pivot861.java (original)
+++ pivot/trunk/tests/src/org/apache/pivot/tests/issues/pivot861/Pivot861.java Fri Oct 4 23:45:40 2013
@@ -22,8 +22,8 @@ import org.apache.pivot.wtk.DesktopAppli
import org.apache.pivot.wtk.Display;
/**
- * Test application to show the memory leak (the subject for this bug).
- * For more info, look at LeakTestWindow.
+ * Test application to show the memory leak (the subject for this bug). For more
+ * info, look at LeakTestWindow.
*/
public class Pivot861 extends Application.Adapter {
@@ -33,8 +33,7 @@ public class Pivot861 extends Applicatio
System.out.println("\n"
+ "Attention: now the application will go in an infinite loop, to be able to see the memory leak.\n"
+ "Note that probably you'll have to kill the application from outside (kill the Java process).\n"
- + "\n"
- );
+ + "\n");
// add some sleep to let users see the warning messages in console ...
Thread.sleep(2000);
Modified: pivot/trunk/tests/src/org/apache/pivot/tests/issues/pivot894/Pivot894.java
URL: http://svn.apache.org/viewvc/pivot/trunk/tests/src/org/apache/pivot/tests/issues/pivot894/Pivot894.java?rev=1529349&r1=1529348&r2=1529349&view=diff
==============================================================================
--- pivot/trunk/tests/src/org/apache/pivot/tests/issues/pivot894/Pivot894.java (original)
+++ pivot/trunk/tests/src/org/apache/pivot/tests/issues/pivot894/Pivot894.java Fri Oct 4 23:45:40 2013
@@ -49,15 +49,14 @@ public class Pivot894 extends Applicatio
System.out.println("\n"
+ "Attention: now the application will go in an infinite loop, to be able to see the memory leak.\n"
+ "Note that probably you'll have to kill the application from outside (kill the Java process).\n"
- + "\n"
- );
+ + "\n");
// add some sleep to let users see the warning messages in console ...
Thread.sleep(2000);
-
final CardPane cardPane = new CardPane();
- cardPane.getStyles().put("selectionChangeEffect", CardPaneSkin.SelectionChangeEffect.HORIZONTAL_SLIDE);
+ cardPane.getStyles().put("selectionChangeEffect",
+ CardPaneSkin.SelectionChangeEffect.HORIZONTAL_SLIDE);
final Window window = new Window(cardPane);
window.open(display);
@@ -67,32 +66,31 @@ public class Pivot894 extends Applicatio
public void run() {
Thread.currentThread().setName("switcher-thread");
- System.out.println("Run num " + num++); // temp
-
+ System.out.println("Run num " + num++); // temp
/*
- //
- // method 1:
- //
- // Seems to be working just fine
- final GridPane grid = new GridPane(3);
- grid.getRows().add(createGridRow());
- grid.getRows().add(createGridRow());
- grid.getRows().add(createGridRow());
+ * // // method 1: // // Seems to be working just fine final
+ * GridPane grid = new GridPane(3);
+ * grid.getRows().add(createGridRow());
+ * grid.getRows().add(createGridRow());
+ * grid.getRows().add(createGridRow());
*/
-
//
// method 2:
//
try {
- // Before the fixes for PIVOT-861 (part two) it was causing out of memory ...
+ // Before the fixes for PIVOT-861 (part two) it was causing
+ // out of memory ...
//
- // Note that this has been moved to another issue, but the problem is due to the usage
- // of dataRenderer tags (and then instancing ButtonDataRenderer) in the loaded bxml,
+ // Note that this has been moved to another issue, but the
+ // problem is due to the usage
+ // of dataRenderer tags (and then instancing
+ // ButtonDataRenderer) in the loaded bxml,
// so probably even this test will be updated ...
//
- final GridPane grid = (GridPane) new BXMLSerializer().readObject(Pivot894.class, "btn_grid.bxml");
+ final GridPane grid = (GridPane) new BXMLSerializer().readObject(
+ Pivot894.class, "btn_grid.bxml");
EventQueue.invokeLater(new Runnable() {
@Override
@@ -125,10 +123,14 @@ public class Pivot894 extends Applicatio
private Row createGridRow() {
Row row = new Row();
try {
- // note that this method doesn't use ApplicationContext cache for images ...
- row.add(new PushButton(new ButtonData(Image.load(new File("clock_icon.png").toURI().toURL()), "Clock")));
- row.add(new PushButton(new ButtonData(Image.load(new File("clock_icon.png").toURI().toURL()), "Clock")));
- row.add(new PushButton(new ButtonData(Image.load(new File("clock_icon.png").toURI().toURL()), "Clock")));
+ // note that this method doesn't use ApplicationContext
+ // cache for images ...
+ row.add(new PushButton(new ButtonData(
+ Image.load(new File("clock_icon.png").toURI().toURL()), "Clock")));
+ row.add(new PushButton(new ButtonData(
+ Image.load(new File("clock_icon.png").toURI().toURL()), "Clock")));
+ row.add(new PushButton(new ButtonData(
+ Image.load(new File("clock_icon.png").toURI().toURL()), "Clock")));
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (TaskExecutionException e) {
Modified: pivot/trunk/tutorials-server/src/org/apache/pivot/tutorials/webqueries/server/ExpenseServlet.java
URL: http://svn.apache.org/viewvc/pivot/trunk/tutorials-server/src/org/apache/pivot/tutorials/webqueries/server/ExpenseServlet.java?rev=1529349&r1=1529348&r2=1529349&view=diff
==============================================================================
--- pivot/trunk/tutorials-server/src/org/apache/pivot/tutorials/webqueries/server/ExpenseServlet.java (original)
+++ pivot/trunk/tutorials-server/src/org/apache/pivot/tutorials/webqueries/server/ExpenseServlet.java Fri Oct 4 23:45:40 2013
@@ -30,8 +30,8 @@ import org.apache.pivot.serialization.CS
import org.apache.pivot.serialization.SerializationException;
import org.apache.pivot.serialization.Serializer;
import org.apache.pivot.web.Query;
-import org.apache.pivot.web.QueryException;
import org.apache.pivot.web.Query.Method;
+import org.apache.pivot.web.QueryException;
import org.apache.pivot.web.server.QueryServlet;
public class ExpenseServlet extends QueryServlet {
@@ -52,7 +52,7 @@ public class ExpenseServlet extends Quer
InputStream inputStream = ExpenseServlet.class.getResourceAsStream("expenses.csv");
try {
- expenses = (List<Expense>)expenseSerializer.readObject(inputStream);
+ expenses = (List<Expense>) expenseSerializer.readObject(inputStream);
} catch (IOException exception) {
throw new ServletException(exception);
} catch (SerializationException exception) {
@@ -96,7 +96,7 @@ public class ExpenseServlet extends Quer
throw new QueryException(Query.Status.BAD_REQUEST);
}
- Expense expense = (Expense)value;
+ Expense expense = (Expense) value;
// Add the expense to the list/map
int id;
@@ -120,8 +120,7 @@ public class ExpenseServlet extends Quer
@Override
protected boolean doPut(Path path, Object value) throws QueryException {
- if (path.getLength() == 0
- || value == null) {
+ if (path.getLength() == 0 || value == null) {
throw new QueryException(Query.Status.BAD_REQUEST);
}
@@ -129,7 +128,7 @@ public class ExpenseServlet extends Quer
int id = Integer.parseInt(path.get(0));
// Create the new expense and bind the data to it
- Expense expense = (Expense)value;
+ Expense expense = (Expense) value;
expense.setID(id);
// Update the list/map
Modified: pivot/trunk/tutorials/src/org/apache/pivot/tutorials/HelloBXML.java
URL: http://svn.apache.org/viewvc/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/HelloBXML.java?rev=1529349&r1=1529348&r2=1529349&view=diff
==============================================================================
--- pivot/trunk/tutorials/src/org/apache/pivot/tutorials/HelloBXML.java (original)
+++ pivot/trunk/tutorials/src/org/apache/pivot/tutorials/HelloBXML.java Fri Oct 4 23:45:40 2013
@@ -27,10 +27,9 @@ public class HelloBXML implements Applic
private Window window = null;
@Override
- public void startup(Display display, Map<String, String> properties)
- throws Exception {
+ public void startup(Display display, Map<String, String> properties) throws Exception {
BXMLSerializer bxmlSerializer = new BXMLSerializer();
- this.window = (Window)bxmlSerializer.readObject(HelloBXML.class, "hello.bxml");
+ this.window = (Window) bxmlSerializer.readObject(HelloBXML.class, "hello.bxml");
this.window.open(display);
}
Modified: pivot/trunk/tutorials/src/org/apache/pivot/tutorials/HelloJava.java
URL: http://svn.apache.org/viewvc/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/HelloJava.java?rev=1529349&r1=1529348&r2=1529349&view=diff
==============================================================================
--- pivot/trunk/tutorials/src/org/apache/pivot/tutorials/HelloJava.java (original)
+++ pivot/trunk/tutorials/src/org/apache/pivot/tutorials/HelloJava.java Fri Oct 4 23:45:40 2013
@@ -39,10 +39,8 @@ public class HelloJava implements Applic
label.setText("Hello World!");
label.getStyles().put("font", new Font("Arial", Font.BOLD, 24));
label.getStyles().put("color", Color.RED);
- label.getStyles().put("horizontalAlignment",
- HorizontalAlignment.CENTER);
- label.getStyles().put("verticalAlignment",
- VerticalAlignment.CENTER);
+ label.getStyles().put("horizontalAlignment", HorizontalAlignment.CENTER);
+ label.getStyles().put("verticalAlignment", VerticalAlignment.CENTER);
this.window.setContent(label);
this.window.setTitle("Hello World!");
Modified: pivot/trunk/tutorials/src/org/apache/pivot/tutorials/KitchenSink.java
URL: http://svn.apache.org/viewvc/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/KitchenSink.java?rev=1529349&r1=1529348&r2=1529349&view=diff
==============================================================================
--- pivot/trunk/tutorials/src/org/apache/pivot/tutorials/KitchenSink.java (original)
+++ pivot/trunk/tutorials/src/org/apache/pivot/tutorials/KitchenSink.java Fri Oct 4 23:45:40 2013
@@ -86,9 +86,8 @@ import org.apache.pivot.wtk.media.Image;
public class KitchenSink implements Application, Application.AboutHandler {
/**
- * A sample of a Custom Table Row.
- * <p>
- * Note that this is public because it's references in one of bxml files of this application.
+ * A sample of a Custom Table Row. <p> Note that this is public because it's
+ * references in one of bxml files of this application.
*/
public static final class CustomTableRow {
private boolean a = false;
@@ -112,7 +111,7 @@ public class KitchenSink implements Appl
}
public void setB(URL bURL) {
- Image imageFromURL = (Image)ApplicationContext.getResourceCache().get(bURL);
+ Image imageFromURL = (Image) ApplicationContext.getResourceCache().get(bURL);
if (imageFromURL == null) {
try {
@@ -166,7 +165,6 @@ public class KitchenSink implements Appl
}
}
-
private abstract class RollupStateHandler implements RollupStateListener {
public RollupStateHandler() {
}
@@ -196,22 +194,29 @@ public class KitchenSink implements Appl
if (this.component == null) {
BXMLSerializer bxmlSerializer = new BXMLSerializer();
try {
- this.component = (Component)bxmlSerializer.readObject(KitchenSink.class, "info.bxml");
- } catch(IOException exception) {
+ this.component = (Component) bxmlSerializer.readObject(KitchenSink.class,
+ "info.bxml");
+ } catch (IOException exception) {
throw new RuntimeException(exception);
- } catch(SerializationException exception) {
+ } catch (SerializationException exception) {
throw new RuntimeException(exception);
}
- this.infoPivotVersion = (Label)bxmlSerializer.getNamespace().get("info-pivot-version");
- this.infoPivotVersion.setText(this.infoPivotVersion.getText() + ApplicationContext.getPivotVersion().toString());
-
- this.infoPivotOrigin = (Label)bxmlSerializer.getNamespace().get("info-pivot-origin");
- String origin = (ApplicationContext.getOrigin() != null) ? ApplicationContext.getOrigin().toString() : "";
+ this.infoPivotVersion = (Label) bxmlSerializer.getNamespace().get(
+ "info-pivot-version");
+ this.infoPivotVersion.setText(this.infoPivotVersion.getText()
+ + ApplicationContext.getPivotVersion().toString());
+
+ this.infoPivotOrigin = (Label) bxmlSerializer.getNamespace().get(
+ "info-pivot-origin");
+ String origin = (ApplicationContext.getOrigin() != null) ? ApplicationContext.getOrigin().toString()
+ : "";
this.infoPivotOrigin.setText(this.infoPivotOrigin.getText() + "\"" + origin + "\"");
- this.infoJavaVersion = (Label)bxmlSerializer.getNamespace().get("info-java-version");
- // String javaVersion = ApplicationContext.getJVMVersion().toString();
+ this.infoJavaVersion = (Label) bxmlSerializer.getNamespace().get(
+ "info-java-version");
+ // String javaVersion =
+ // ApplicationContext.getJVMVersion().toString();
String javaVersion = System.getProperty("java.version");
this.infoJavaVersion.setText(this.infoJavaVersion.getText() + javaVersion);
@@ -233,10 +238,11 @@ public class KitchenSink implements Appl
if (this.component == null) {
BXMLSerializer bxmlSerializer = new BXMLSerializer();
try {
- this.component = (Component)bxmlSerializer.readObject(KitchenSink.class, "buttons.bxml");
- } catch(IOException exception) {
+ this.component = (Component) bxmlSerializer.readObject(KitchenSink.class,
+ "buttons.bxml");
+ } catch (IOException exception) {
throw new RuntimeException(exception);
- } catch(SerializationException exception) {
+ } catch (SerializationException exception) {
throw new RuntimeException(exception);
}
@@ -262,22 +268,26 @@ public class KitchenSink implements Appl
if (this.component == null) {
BXMLSerializer bxmlSerializer = new BXMLSerializer();
try {
- this.component = (Component)bxmlSerializer.readObject(KitchenSink.class, "lists.bxml");
- } catch(IOException exception) {
+ this.component = (Component) bxmlSerializer.readObject(KitchenSink.class,
+ "lists.bxml");
+ } catch (IOException exception) {
throw new RuntimeException(exception);
- } catch(SerializationException exception) {
+ } catch (SerializationException exception) {
throw new RuntimeException(exception);
}
- this.editableListView = (ListView)bxmlSerializer.getNamespace().get("editableListView");
- this.iconListView = (ListView)bxmlSerializer.getNamespace().get("iconListView");
- this.checkedListView = (ListView)bxmlSerializer.getNamespace().get("checkedListView");
- this.iconListButton = (ListButton)bxmlSerializer.getNamespace().get("iconListButton");
+ this.editableListView = (ListView) bxmlSerializer.getNamespace().get(
+ "editableListView");
+ this.iconListView = (ListView) bxmlSerializer.getNamespace().get("iconListView");
+ this.checkedListView = (ListView) bxmlSerializer.getNamespace().get(
+ "checkedListView");
+ this.iconListButton = (ListButton) bxmlSerializer.getNamespace().get(
+ "iconListButton");
rollup.setContent(this.component);
@SuppressWarnings("unchecked")
- List<ListItem> listData = (List<ListItem>)this.editableListView.getListData();
+ List<ListItem> listData = (List<ListItem>) this.editableListView.getListData();
listData.setComparator(new Comparator<ListItem>() {
@Override
public int compare(ListItem listItem1, ListItem listItem2) {
@@ -287,7 +297,6 @@ public class KitchenSink implements Appl
}
});
-
Filter<ListItem> disabledItemFilter = new Filter<ListItem>() {
@Override
public boolean include(ListItem listItem) {
@@ -318,10 +327,11 @@ public class KitchenSink implements Appl
if (this.component == null) {
BXMLSerializer bxmlSerializer = new BXMLSerializer();
try {
- this.component = (Component)bxmlSerializer.readObject(KitchenSink.class, "text.bxml");
- } catch(IOException exception) {
+ this.component = (Component) bxmlSerializer.readObject(KitchenSink.class,
+ "text.bxml");
+ } catch (IOException exception) {
throw new RuntimeException(exception);
- } catch(SerializationException exception) {
+ } catch (SerializationException exception) {
throw new RuntimeException(exception);
}
@@ -343,10 +353,11 @@ public class KitchenSink implements Appl
if (this.component == null) {
BXMLSerializer bxmlSerializer = new BXMLSerializer();
try {
- this.component = (Component)bxmlSerializer.readObject(KitchenSink.class, "calendars.bxml");
- } catch(IOException exception) {
+ this.component = (Component) bxmlSerializer.readObject(KitchenSink.class,
+ "calendars.bxml");
+ } catch (IOException exception) {
throw new RuntimeException(exception);
- } catch(SerializationException exception) {
+ } catch (SerializationException exception) {
throw new RuntimeException(exception);
}
@@ -368,10 +379,11 @@ public class KitchenSink implements Appl
if (this.component == null) {
BXMLSerializer bxmlSerializer = new BXMLSerializer();
try {
- this.component = (Component)bxmlSerializer.readObject(KitchenSink.class, "color_choosers.bxml");
- } catch(IOException exception) {
+ this.component = (Component) bxmlSerializer.readObject(KitchenSink.class,
+ "color_choosers.bxml");
+ } catch (IOException exception) {
throw new RuntimeException(exception);
- } catch(SerializationException exception) {
+ } catch (SerializationException exception) {
throw new RuntimeException(exception);
}
@@ -393,10 +405,11 @@ public class KitchenSink implements Appl
if (this.component == null) {
BXMLSerializer bxmlSerializer = new BXMLSerializer();
try {
- this.component = (Component)bxmlSerializer.readObject(KitchenSink.class, "navigation.bxml");
- } catch(IOException exception) {
+ this.component = (Component) bxmlSerializer.readObject(KitchenSink.class,
+ "navigation.bxml");
+ } catch (IOException exception) {
throw new RuntimeException(exception);
- } catch(SerializationException exception) {
+ } catch (SerializationException exception) {
throw new RuntimeException(exception);
}
@@ -418,10 +431,11 @@ public class KitchenSink implements Appl
if (this.component == null) {
BXMLSerializer bxmlSerializer = new BXMLSerializer();
try {
- this.component = (Component)bxmlSerializer.readObject(KitchenSink.class, "splitters.bxml");
- } catch(IOException exception) {
+ this.component = (Component) bxmlSerializer.readObject(KitchenSink.class,
+ "splitters.bxml");
+ } catch (IOException exception) {
throw new RuntimeException(exception);
- } catch(SerializationException exception) {
+ } catch (SerializationException exception) {
throw new RuntimeException(exception);
}
@@ -456,12 +470,13 @@ public class KitchenSink implements Appl
public void perform(Component source) {
Button selectedItem = MenusRollupStateHandler.this.imageMenuGroup.getSelection();
- String imageName = (String)selectedItem.getUserData().get("image");
+ String imageName = (String) selectedItem.getUserData().get("image");
URL imageURL = getClass().getResource(imageName);
- // If the image has not been added to the resource cache yet,
+ // If the image has not been added to the resource cache
+ // yet,
// add it
- Image image = (Image)ApplicationContext.getResourceCache().get(imageURL);
+ Image image = (Image) ApplicationContext.getResourceCache().get(imageURL);
if (image == null) {
try {
@@ -480,24 +495,28 @@ public class KitchenSink implements Appl
BXMLSerializer bxmlSerializer = new BXMLSerializer();
try {
- this.component = (Component)bxmlSerializer.readObject(KitchenSink.class, "menus.bxml");
- } catch(IOException exception) {
+ this.component = (Component) bxmlSerializer.readObject(KitchenSink.class,
+ "menus.bxml");
+ } catch (IOException exception) {
throw new RuntimeException(exception);
- } catch(SerializationException exception) {
+ } catch (SerializationException exception) {
throw new RuntimeException(exception);
}
- this.menuImageView = (ImageView)bxmlSerializer.getNamespace().get("menuImageView");
- this.helpAboutMenuItem = (Menu.Item)bxmlSerializer.getNamespace().get("helpAboutMenuItem");
+ this.menuImageView = (ImageView) bxmlSerializer.getNamespace().get("menuImageView");
+ this.helpAboutMenuItem = (Menu.Item) bxmlSerializer.getNamespace().get(
+ "helpAboutMenuItem");
rollup.setContent(this.component);
try {
- this.menuSection = (Menu.Section)bxmlSerializer.readObject(KitchenSink.class, "menu_section.bxml");
- this.imageMenuGroup = (ButtonGroup)bxmlSerializer.getNamespace().get("imageMenuGroup");
- } catch(IOException exception) {
+ this.menuSection = (Menu.Section) bxmlSerializer.readObject(KitchenSink.class,
+ "menu_section.bxml");
+ this.imageMenuGroup = (ButtonGroup) bxmlSerializer.getNamespace().get(
+ "imageMenuGroup");
+ } catch (IOException exception) {
throw new RuntimeException(exception);
- } catch(SerializationException exception) {
+ } catch (SerializationException exception) {
throw new RuntimeException(exception);
}
@@ -535,38 +554,43 @@ public class KitchenSink implements Appl
if (this.component == null) {
BXMLSerializer bxmlSerializer = new BXMLSerializer();
try {
- this.component = (Component)bxmlSerializer.readObject(KitchenSink.class, "meters.bxml");
- } catch(IOException exception) {
+ this.component = (Component) bxmlSerializer.readObject(KitchenSink.class,
+ "meters.bxml");
+ } catch (IOException exception) {
throw new RuntimeException(exception);
- } catch(SerializationException exception) {
+ } catch (SerializationException exception) {
throw new RuntimeException(exception);
}
- this.activityIndicator1 = (ActivityIndicator)bxmlSerializer.getNamespace().get("activityIndicator1");
- this.activityIndicator2 = (ActivityIndicator)bxmlSerializer.getNamespace().get("activityIndicator2");
- this.activityIndicator3 = (ActivityIndicator)bxmlSerializer.getNamespace().get("activityIndicator3");
+ this.activityIndicator1 = (ActivityIndicator) bxmlSerializer.getNamespace().get(
+ "activityIndicator1");
+ this.activityIndicator2 = (ActivityIndicator) bxmlSerializer.getNamespace().get(
+ "activityIndicator2");
+ this.activityIndicator3 = (ActivityIndicator) bxmlSerializer.getNamespace().get(
+ "activityIndicator3");
rollup.setContent(this.component);
- KitchenSink.this.metersRollup.getRollupStateListeners().add(new RollupStateListener() {
- @Override
- public Vote previewExpandedChange(Rollup roll) {
- return Vote.APPROVE;
- }
+ KitchenSink.this.metersRollup.getRollupStateListeners().add(
+ new RollupStateListener() {
+ @Override
+ public Vote previewExpandedChange(Rollup roll) {
+ return Vote.APPROVE;
+ }
- @Override
- public void expandedChangeVetoed(Rollup roll, Vote reason) {
- // No-op
- }
+ @Override
+ public void expandedChangeVetoed(Rollup roll, Vote reason) {
+ // No-op
+ }
- @Override
- public void expandedChanged(Rollup roll) {
- MetersRollupStateHandler.this.activityIndicator1.setActive(roll.isExpanded());
- MetersRollupStateHandler.this.activityIndicator2.setActive(roll.isExpanded());
- MetersRollupStateHandler.this.activityIndicator3.setActive(roll.isExpanded());
- }
- });
-}
+ @Override
+ public void expandedChanged(Rollup roll) {
+ MetersRollupStateHandler.this.activityIndicator1.setActive(roll.isExpanded());
+ MetersRollupStateHandler.this.activityIndicator2.setActive(roll.isExpanded());
+ MetersRollupStateHandler.this.activityIndicator3.setActive(roll.isExpanded());
+ }
+ });
+ }
return Vote.APPROVE;
}
@@ -591,20 +615,21 @@ public class KitchenSink implements Appl
if (this.component == null) {
BXMLSerializer bxmlSerializer = new BXMLSerializer();
try {
- this.component = (Component)bxmlSerializer.readObject(KitchenSink.class, "spinners.bxml");
- } catch(IOException exception) {
+ this.component = (Component) bxmlSerializer.readObject(KitchenSink.class,
+ "spinners.bxml");
+ } catch (IOException exception) {
throw new RuntimeException(exception);
- } catch(SerializationException exception) {
+ } catch (SerializationException exception) {
throw new RuntimeException(exception);
}
- this.numericSpinner = (Spinner)bxmlSerializer.getNamespace().get("numericSpinner");
- this.dateSpinner = (Spinner)bxmlSerializer.getNamespace().get("dateSpinner");
+ this.numericSpinner = (Spinner) bxmlSerializer.getNamespace().get("numericSpinner");
+ this.dateSpinner = (Spinner) bxmlSerializer.getNamespace().get("dateSpinner");
- this.redSlider = (Slider)bxmlSerializer.getNamespace().get("redSlider");
- this.greenSlider = (Slider)bxmlSerializer.getNamespace().get("greenSlider");
- this.blueSlider = (Slider)bxmlSerializer.getNamespace().get("blueSlider");
- this.colorBorder = (Border)bxmlSerializer.getNamespace().get("colorBorder");
+ this.redSlider = (Slider) bxmlSerializer.getNamespace().get("redSlider");
+ this.greenSlider = (Slider) bxmlSerializer.getNamespace().get("greenSlider");
+ this.blueSlider = (Slider) bxmlSerializer.getNamespace().get("blueSlider");
+ this.colorBorder = (Border) bxmlSerializer.getNamespace().get("colorBorder");
rollup.setContent(this.component);
@@ -614,9 +639,12 @@ public class KitchenSink implements Appl
SliderValueListener sliderValueListener = new SliderValueListener() {
@Override
public void valueChanged(Slider slider, int previousValue) {
- Color color = new Color(SpinnersRollupStateHandler.this.redSlider.getValue(), SpinnersRollupStateHandler.this.greenSlider.getValue(),
+ Color color = new Color(
+ SpinnersRollupStateHandler.this.redSlider.getValue(),
+ SpinnersRollupStateHandler.this.greenSlider.getValue(),
SpinnersRollupStateHandler.this.blueSlider.getValue());
- SpinnersRollupStateHandler.this.colorBorder.getStyles().put("backgroundColor", color);
+ SpinnersRollupStateHandler.this.colorBorder.getStyles().put(
+ "backgroundColor", color);
}
};
@@ -641,7 +669,8 @@ public class KitchenSink implements Appl
private void initializeDateSpinner(Spinner spinner) {
CalendarDate lowerBound = new CalendarDate(2008, 0, 0);
CalendarDate upperBound = new CalendarDate(2019, 11, 30);
- CalendarDateSpinnerData spinnerData = new CalendarDateSpinnerData(lowerBound, upperBound);
+ CalendarDateSpinnerData spinnerData = new CalendarDateSpinnerData(lowerBound,
+ upperBound);
CalendarDate today = new CalendarDate();
spinner.setSpinnerData(spinnerData);
@@ -662,15 +691,18 @@ public class KitchenSink implements Appl
if (this.component == null) {
BXMLSerializer bxmlSerializer = new BXMLSerializer();
try {
- this.component = (Component)bxmlSerializer.readObject(KitchenSink.class, "tables.bxml");
- } catch(IOException exception) {
+ this.component = (Component) bxmlSerializer.readObject(KitchenSink.class,
+ "tables.bxml");
+ } catch (IOException exception) {
throw new RuntimeException(exception);
- } catch(SerializationException exception) {
+ } catch (SerializationException exception) {
throw new RuntimeException(exception);
}
- this.sortableTableView = (TableView)bxmlSerializer.getNamespace().get("sortableTableView");
- this.customTableView = (TableView)bxmlSerializer.getNamespace().get("customTableView");
+ this.sortableTableView = (TableView) bxmlSerializer.getNamespace().get(
+ "sortableTableView");
+ this.customTableView = (TableView) bxmlSerializer.getNamespace().get(
+ "customTableView");
rollup.setContent(this.component);
@@ -689,10 +721,10 @@ public class KitchenSink implements Appl
HashMap<String, Integer> tableRow = new HashMap<>();
tableRow.put("i", i);
- tableRow.put("a", (int)Math.round(Math.random() * 10));
- tableRow.put("b", (int)Math.round(Math.random() * 100));
- tableRow.put("c", (int)Math.round(Math.random() * 1000));
- tableRow.put("d", (int)Math.round(Math.random() * 10000));
+ tableRow.put("a", (int) Math.round(Math.random() * 10));
+ tableRow.put("b", (int) Math.round(Math.random() * 100));
+ tableRow.put("c", (int) Math.round(Math.random() * 1000));
+ tableRow.put("d", (int) Math.round(Math.random() * 10000));
tableData.add(tableRow);
}
@@ -723,32 +755,33 @@ public class KitchenSink implements Appl
private void resort(TableView tableView) {
@SuppressWarnings("unchecked")
- List<Object> tableDataOfTableView = (List<Object>)tableView.getTableData();
+ List<Object> tableDataOfTableView = (List<Object>) tableView.getTableData();
tableDataOfTableView.setComparator(new TableViewRowComparator(tableView));
}
});
- this.customTableView.getComponentMouseButtonListeners().add(new ComponentMouseButtonListener.Adapter() {
- @Override
- public boolean mouseClick(Component comp, Mouse.Button button, int x, int y, int count) {
- if (button == Mouse.Button.LEFT) {
- @SuppressWarnings("unchecked")
- List<CustomTableRow> customTableData =
- (List<CustomTableRow>)TablesRollupStateHandler.this.customTableView.getTableData();
-
- int columnIndex = TablesRollupStateHandler.this.customTableView.getColumnAt(x);
- if (columnIndex == 0) {
- int rowIndex = TablesRollupStateHandler.this.customTableView.getRowAt(y);
- CustomTableRow row = customTableData.get(rowIndex);
-
- row.setA(!row.getA());
- customTableData.update(rowIndex, row);
+ this.customTableView.getComponentMouseButtonListeners().add(
+ new ComponentMouseButtonListener.Adapter() {
+ @Override
+ public boolean mouseClick(Component comp, Mouse.Button button, int x,
+ int y, int count) {
+ if (button == Mouse.Button.LEFT) {
+ @SuppressWarnings("unchecked")
+ List<CustomTableRow> customTableData = (List<CustomTableRow>) TablesRollupStateHandler.this.customTableView.getTableData();
+
+ int columnIndex = TablesRollupStateHandler.this.customTableView.getColumnAt(x);
+ if (columnIndex == 0) {
+ int rowIndex = TablesRollupStateHandler.this.customTableView.getRowAt(y);
+ CustomTableRow row = customTableData.get(rowIndex);
+
+ row.setA(!row.getA());
+ customTableData.update(rowIndex, row);
+ }
}
- }
- return false;
- }
- });
+ return false;
+ }
+ });
}
return Vote.APPROVE;
@@ -768,19 +801,21 @@ public class KitchenSink implements Appl
if (this.component == null) {
BXMLSerializer bxmlSerializer = new BXMLSerializer();
try {
- this.component = (Component)bxmlSerializer.readObject(KitchenSink.class, "trees.bxml");
- } catch(IOException exception) {
+ this.component = (Component) bxmlSerializer.readObject(KitchenSink.class,
+ "trees.bxml");
+ } catch (IOException exception) {
throw new RuntimeException(exception);
- } catch(SerializationException exception) {
+ } catch (SerializationException exception) {
throw new RuntimeException(exception);
}
- this.editableTreeView = (TreeView)bxmlSerializer.getNamespace().get("editableTreeView");
- this.checkTreeView = (TreeView)bxmlSerializer.getNamespace().get("checkTreeView");
+ this.editableTreeView = (TreeView) bxmlSerializer.getNamespace().get(
+ "editableTreeView");
+ this.checkTreeView = (TreeView) bxmlSerializer.getNamespace().get("checkTreeView");
rollup.setContent(this.component);
- TreeBranch treeData = (TreeBranch)this.editableTreeView.getTreeData();
+ TreeBranch treeData = (TreeBranch) this.editableTreeView.getTreeData();
treeData.setComparator(new TreeNodeComparator());
this.checkTreeView.setDisabledNodeFilter(new Filter<TreeNode>() {
@@ -827,16 +862,17 @@ public class KitchenSink implements Appl
if (this.component == null) {
BXMLSerializer bxmlSerializer = new BXMLSerializer();
try {
- this.component = (Component)bxmlSerializer.readObject(KitchenSink.class, "dragdrop.bxml");
- } catch(IOException exception) {
+ this.component = (Component) bxmlSerializer.readObject(KitchenSink.class,
+ "dragdrop.bxml");
+ } catch (IOException exception) {
throw new RuntimeException(exception);
- } catch(SerializationException exception) {
+ } catch (SerializationException exception) {
throw new RuntimeException(exception);
}
- this.imageView1 = (ImageView)bxmlSerializer.getNamespace().get("imageView1");
- this.imageView2 = (ImageView)bxmlSerializer.getNamespace().get("imageView2");
- this.imageView3 = (ImageView)bxmlSerializer.getNamespace().get("imageView3");
+ this.imageView1 = (ImageView) bxmlSerializer.getNamespace().get("imageView1");
+ this.imageView2 = (ImageView) bxmlSerializer.getNamespace().get("imageView2");
+ this.imageView3 = (ImageView) bxmlSerializer.getNamespace().get("imageView3");
rollup.setContent(this.component);
@@ -847,15 +883,16 @@ public class KitchenSink implements Appl
@Override
public boolean beginDrag(Component comp, int x, int y) {
- ImageView imageView = (ImageView)comp;
+ ImageView imageView = (ImageView) comp;
this.image = imageView.getImage();
if (this.image != null) {
- imageView.setImage((Image)null);
+ imageView.setImage((Image) null);
this.content = new LocalManifest();
this.content.putImage(this.image);
- this.offset = new Point(x - (imageView.getWidth() - this.image.getWidth()) / 2,
- y - (imageView.getHeight() - this.image.getHeight()) / 2);
+ this.offset = new Point(x
+ - (imageView.getWidth() - this.image.getWidth()) / 2, y
+ - (imageView.getHeight() - this.image.getHeight()) / 2);
}
return (this.image != null);
@@ -864,7 +901,7 @@ public class KitchenSink implements Appl
@Override
public void endDrag(Component comp, DropAction dropAction) {
if (dropAction == null) {
- ImageView imageView = (ImageView)comp;
+ ImageView imageView = (ImageView) comp;
imageView.setImage(this.image);
}
@@ -905,9 +942,8 @@ public class KitchenSink implements Appl
int supportedDropActions, DropAction userDropAction) {
DropAction dropAction = null;
- ImageView imageView = (ImageView)comp;
- if (imageView.getImage() == null
- && dragContent.containsImage()
+ ImageView imageView = (ImageView) comp;
+ if (imageView.getImage() == null && dragContent.containsImage()
&& DropAction.MOVE.isSelected(supportedDropActions)) {
dropAction = DropAction.MOVE;
comp.getStyles().put("backgroundColor", "#f0e68c");
@@ -924,17 +960,17 @@ public class KitchenSink implements Appl
@Override
public DropAction dragMove(Component comp, Manifest dragContent,
int supportedDropActions, int x, int y, DropAction userDropAction) {
- ImageView imageView = (ImageView)comp;
- return (imageView.getImage() == null
- && dragContent.containsImage() ? DropAction.MOVE : null);
+ ImageView imageView = (ImageView) comp;
+ return (imageView.getImage() == null && dragContent.containsImage() ? DropAction.MOVE
+ : null);
}
@Override
public DropAction userDropActionChange(Component comp, Manifest dragContent,
int supportedDropActions, int x, int y, DropAction userDropAction) {
- ImageView imageView = (ImageView)comp;
- return (imageView.getImage() == null
- && dragContent.containsImage() ? DropAction.MOVE : null);
+ ImageView imageView = (ImageView) comp;
+ return (imageView.getImage() == null && dragContent.containsImage() ? DropAction.MOVE
+ : null);
}
@Override
@@ -942,13 +978,12 @@ public class KitchenSink implements Appl
int supportedDropActions, int x, int y, DropAction userDropAction) {
DropAction dropAction = null;
- ImageView imageView = (ImageView)comp;
- if (imageView.getImage() == null
- && dragContent.containsImage()) {
+ ImageView imageView = (ImageView) comp;
+ if (imageView.getImage() == null && dragContent.containsImage()) {
try {
imageView.setImage(dragContent.getImage());
dropAction = DropAction.MOVE;
- } catch(IOException exception) {
+ } catch (IOException exception) {
System.err.println(exception);
}
}
@@ -987,16 +1022,18 @@ public class KitchenSink implements Appl
if (this.component == null) {
BXMLSerializer bxmlSerializer = new BXMLSerializer();
try {
- this.component = (Component)bxmlSerializer.readObject(KitchenSink.class, "alerts.bxml");
- } catch(IOException exception) {
+ this.component = (Component) bxmlSerializer.readObject(KitchenSink.class,
+ "alerts.bxml");
+ } catch (IOException exception) {
throw new RuntimeException(exception);
- } catch(SerializationException exception) {
+ } catch (SerializationException exception) {
throw new RuntimeException(exception);
}
- this.alertButton = (PushButton)bxmlSerializer.getNamespace().get("alertButton");
- this.promptButton = (PushButton)bxmlSerializer.getNamespace().get("promptButton");
- this.messageTypeGroup = (ButtonGroup)bxmlSerializer.getNamespace().get("messageTypeGroup");
+ this.alertButton = (PushButton) bxmlSerializer.getNamespace().get("alertButton");
+ this.promptButton = (PushButton) bxmlSerializer.getNamespace().get("promptButton");
+ this.messageTypeGroup = (ButtonGroup) bxmlSerializer.getNamespace().get(
+ "messageTypeGroup");
rollup.setContent(this.component);
@@ -1007,12 +1044,13 @@ public class KitchenSink implements Appl
Map<String, ?> userData;
try {
- userData = JSONSerializer.parseMap((String)selection.getUserData().get("messageInfo"));
+ userData = JSONSerializer.parseMap((String) selection.getUserData().get(
+ "messageInfo"));
} catch (SerializationException exception) {
throw new RuntimeException(exception);
}
- String messageType = (String)userData.get("messageType");
+ String messageType = (String) userData.get("messageType");
if (messageType == null) {
ArrayList<String> options = new ArrayList<>();
@@ -1022,20 +1060,22 @@ public class KitchenSink implements Appl
Component body = null;
BXMLSerializer serializer = new BXMLSerializer();
try {
- body = (Component)serializer.readObject(KitchenSink.class, "alert.bxml");
- } catch(Exception exception) {
+ body = (Component) serializer.readObject(KitchenSink.class,
+ "alert.bxml");
+ } catch (Exception exception) {
System.err.println(exception);
}
- Alert alert = new Alert(MessageType.QUESTION, "Please select your favorite icon:",
- options, body);
+ Alert alert = new Alert(MessageType.QUESTION,
+ "Please select your favorite icon:", options, body);
alert.setTitle("Select Icon");
alert.setSelectedOptionIndex(0);
alert.getDecorators().update(0, new ReflectionDecorator());
alert.open(KitchenSink.this.window);
} else {
- String message = (String)userData.get("message");
- Alert.alert(MessageType.valueOf(messageType.toUpperCase()), message, KitchenSink.this.window);
+ String message = (String) userData.get("message");
+ Alert.alert(MessageType.valueOf(messageType.toUpperCase()), message,
+ KitchenSink.this.window);
}
}
});
@@ -1047,12 +1087,13 @@ public class KitchenSink implements Appl
Map<String, ?> userData;
try {
- userData = JSONSerializer.parseMap((String)selection.getUserData().get("messageInfo"));
+ userData = JSONSerializer.parseMap((String) selection.getUserData().get(
+ "messageInfo"));
} catch (SerializationException exception) {
throw new RuntimeException(exception);
}
- String messageType = (String)userData.get("messageType");
+ String messageType = (String) userData.get("messageType");
if (messageType == null) {
ArrayList<String> options = new ArrayList<>();
@@ -1062,20 +1103,22 @@ public class KitchenSink implements Appl
Component body = null;
BXMLSerializer serializer = new BXMLSerializer();
try {
- body = (Component)serializer.readObject(KitchenSink.class, "alert.bxml");
- } catch(Exception exception) {
+ body = (Component) serializer.readObject(KitchenSink.class,
+ "alert.bxml");
+ } catch (Exception exception) {
System.err.println(exception);
}
- Prompt prompt = new Prompt(MessageType.QUESTION, "Please select your favorite icon:",
- options, body);
+ Prompt prompt = new Prompt(MessageType.QUESTION,
+ "Please select your favorite icon:", options, body);
prompt.setTitle("Select Icon");
prompt.setSelectedOptionIndex(0);
prompt.getDecorators().update(0, new ReflectionDecorator());
prompt.open(KitchenSink.this.window);
} else {
- String message = (String)userData.get("message");
- Prompt.prompt(MessageType.valueOf(messageType.toUpperCase()), message, KitchenSink.this.window);
+ String message = (String) userData.get("message");
+ Prompt.prompt(MessageType.valueOf(messageType.toUpperCase()), message,
+ KitchenSink.this.window);
}
}
});
@@ -1085,7 +1128,6 @@ public class KitchenSink implements Appl
}
}
-
Window window = null;
Rollup infoRollup;
Rollup buttonsRollup;
@@ -1103,11 +1145,10 @@ public class KitchenSink implements Appl
Rollup dragDropRollup;
Rollup alertsRollup;
-
@Override
public void aboutRequested() {
- String about = "Origin: " + ApplicationContext.getOrigin()
- + "; JVM version: " + ApplicationContext.getJVMVersion();
+ String about = "Origin: " + ApplicationContext.getOrigin() + "; JVM version: "
+ + ApplicationContext.getJVMVersion();
Prompt.prompt(about, this.window);
}
@@ -1115,52 +1156,53 @@ public class KitchenSink implements Appl
@Override
public void startup(Display display, Map<String, String> properties) throws Exception {
BXMLSerializer bxmlSerializer = new BXMLSerializer();
- this.window = (Window)bxmlSerializer.readObject(KitchenSink.class, "kitchen_sink.bxml");
+ this.window = (Window) bxmlSerializer.readObject(KitchenSink.class, "kitchen_sink.bxml");
bxmlSerializer.bind(this, KitchenSink.class);
- this.infoRollup = (Rollup)bxmlSerializer.getNamespace().get("infoRollup");
+ this.infoRollup = (Rollup) bxmlSerializer.getNamespace().get("infoRollup");
this.infoRollup.getRollupStateListeners().add(new InfoRollupStateHandler());
- this.buttonsRollup = (Rollup)bxmlSerializer.getNamespace().get("buttonsRollup");
+ this.buttonsRollup = (Rollup) bxmlSerializer.getNamespace().get("buttonsRollup");
this.buttonsRollup.getRollupStateListeners().add(new ButtonsRollupStateHandler());
- this.listsRollup = (Rollup)bxmlSerializer.getNamespace().get("listsRollup");
+ this.listsRollup = (Rollup) bxmlSerializer.getNamespace().get("listsRollup");
this.listsRollup.getRollupStateListeners().add(new ListsRollupStateHandler());
- this.textRollup = (Rollup)bxmlSerializer.getNamespace().get("textRollup");
+ this.textRollup = (Rollup) bxmlSerializer.getNamespace().get("textRollup");
this.textRollup.getRollupStateListeners().add(new TextRollupStateHandler());
- this.calendarsRollup = (Rollup)bxmlSerializer.getNamespace().get("calendarsRollup");
+ this.calendarsRollup = (Rollup) bxmlSerializer.getNamespace().get("calendarsRollup");
this.calendarsRollup.getRollupStateListeners().add(new CalendarsRollupStateHandler());
- this.colorChoosersRollup = (Rollup)bxmlSerializer.getNamespace().get("colorChoosersRollup");
- this.colorChoosersRollup.getRollupStateListeners().add(new ColorChoosersRollupStateHandler());
+ this.colorChoosersRollup = (Rollup) bxmlSerializer.getNamespace().get("colorChoosersRollup");
+ this.colorChoosersRollup.getRollupStateListeners().add(
+ new ColorChoosersRollupStateHandler());
- this.navigationRollup = (Rollup)bxmlSerializer.getNamespace().get("navigationRollup");
+ this.navigationRollup = (Rollup) bxmlSerializer.getNamespace().get("navigationRollup");
this.navigationRollup.getRollupStateListeners().add(new NavigationRollupStateHandler());
- this.splittersRollup = (Rollup)bxmlSerializer.getNamespace().get("splittersRollup");
+ this.splittersRollup = (Rollup) bxmlSerializer.getNamespace().get("splittersRollup");
this.splittersRollup.getRollupStateListeners().add(new SplittersRollupStateHandler());
- this.menusRollup = (Rollup)bxmlSerializer.getNamespace().get("menusRollup");
+ this.menusRollup = (Rollup) bxmlSerializer.getNamespace().get("menusRollup");
this.menusRollup.getRollupStateListeners().add(new MenusRollupStateHandler());
- this.metersRollup = (Rollup)bxmlSerializer.getNamespace().get("metersRollup");
+ this.metersRollup = (Rollup) bxmlSerializer.getNamespace().get("metersRollup");
this.metersRollup.getRollupStateListeners().add(new MetersRollupStateHandler());
- this.spinnersRollup = (Rollup)bxmlSerializer.getNamespace().get("spinnersRollup");
+ this.spinnersRollup = (Rollup) bxmlSerializer.getNamespace().get("spinnersRollup");
this.spinnersRollup.getRollupStateListeners().add(new SpinnersRollupStateHandler());
- this.tablesRollup = (Rollup)bxmlSerializer.getNamespace().get("tablesRollup");
+ this.tablesRollup = (Rollup) bxmlSerializer.getNamespace().get("tablesRollup");
this.tablesRollup.getRollupStateListeners().add(new TablesRollupStateHandler());
- this.treesRollup = (Rollup)bxmlSerializer.getNamespace().get("treesRollup");
+ this.treesRollup = (Rollup) bxmlSerializer.getNamespace().get("treesRollup");
this.treesRollup.getRollupStateListeners().add(new TreesRollupStateHandler());
- this.dragDropRollup = (Rollup)bxmlSerializer.getNamespace().get("dragDropRollup");
+ this.dragDropRollup = (Rollup) bxmlSerializer.getNamespace().get("dragDropRollup");
this.dragDropRollup.getRollupStateListeners().add(new DragDropRollupStateHandler());
- this.alertsRollup = (Rollup)bxmlSerializer.getNamespace().get("alertsRollup");
+ this.alertsRollup = (Rollup) bxmlSerializer.getNamespace().get("alertsRollup");
this.alertsRollup.getRollupStateListeners().add(new AlertsRollupStateHandler());
this.window.open(display);
Modified: pivot/trunk/tutorials/src/org/apache/pivot/tutorials/backgroundtasks/BackgroundTasks.java
URL: http://svn.apache.org/viewvc/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/backgroundtasks/BackgroundTasks.java?rev=1529349&r1=1529348&r2=1529349&view=diff
==============================================================================
--- pivot/trunk/tutorials/src/org/apache/pivot/tutorials/backgroundtasks/BackgroundTasks.java (original)
+++ pivot/trunk/tutorials/src/org/apache/pivot/tutorials/backgroundtasks/BackgroundTasks.java Fri Oct 4 23:45:40 2013
@@ -38,9 +38,9 @@ public class BackgroundTasks extends Win
@Override
public void initialize(Map<String, Object> namespace, URL location, Resources resources) {
- activityIndicator = (ActivityIndicator)namespace.get("activityIndicator");
- executeSynchronousButton = (PushButton)namespace.get("executeSynchronousButton");
- executeAsynchronousButton = (PushButton)namespace.get("executeAsynchronousButton");
+ activityIndicator = (ActivityIndicator) namespace.get("activityIndicator");
+ executeSynchronousButton = (PushButton) namespace.get("executeSynchronousButton");
+ executeAsynchronousButton = (PushButton) namespace.get("executeAsynchronousButton");
executeSynchronousButton.getButtonPressListeners().add(new ButtonPressListener() {
@Override
Modified: pivot/trunk/tutorials/src/org/apache/pivot/tutorials/boundedrange/Sliders.java
URL: http://svn.apache.org/viewvc/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/boundedrange/Sliders.java?rev=1529349&r1=1529348&r2=1529349&view=diff
==============================================================================
--- pivot/trunk/tutorials/src/org/apache/pivot/tutorials/boundedrange/Sliders.java (original)
+++ pivot/trunk/tutorials/src/org/apache/pivot/tutorials/boundedrange/Sliders.java Fri Oct 4 23:45:40 2013
@@ -32,8 +32,8 @@ public class Sliders extends Window impl
@Override
public void initialize(Map<String, Object> namespace, URL location, Resources resources) {
- slider = (Slider)namespace.get("slider");
- label = (Label)namespace.get("label");
+ slider = (Slider) namespace.get("slider");
+ label = (Label) namespace.get("label");
slider.getSliderValueListeners().add(new SliderValueListener() {
@Override
Modified: pivot/trunk/tutorials/src/org/apache/pivot/tutorials/buttons/PushButtons.java
URL: http://svn.apache.org/viewvc/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/buttons/PushButtons.java?rev=1529349&r1=1529348&r2=1529349&view=diff
==============================================================================
--- pivot/trunk/tutorials/src/org/apache/pivot/tutorials/buttons/PushButtons.java (original)
+++ pivot/trunk/tutorials/src/org/apache/pivot/tutorials/buttons/PushButtons.java Fri Oct 4 23:45:40 2013
@@ -33,7 +33,7 @@ public class PushButtons extends Window
@Override
public void initialize(Map<String, Object> namespace, URL location, Resources resources) {
- pushButton = (PushButton)namespace.get("pushButton");
+ pushButton = (PushButton) namespace.get("pushButton");
pushButton.getButtonPressListeners().add(new ButtonPressListener() {
@Override
Modified: pivot/trunk/tutorials/src/org/apache/pivot/tutorials/buttons/RadioButtons.java
URL: http://svn.apache.org/viewvc/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/buttons/RadioButtons.java?rev=1529349&r1=1529348&r2=1529349&view=diff
==============================================================================
--- pivot/trunk/tutorials/src/org/apache/pivot/tutorials/buttons/RadioButtons.java (original)
+++ pivot/trunk/tutorials/src/org/apache/pivot/tutorials/buttons/RadioButtons.java Fri Oct 4 23:45:40 2013
@@ -34,17 +34,16 @@ public class RadioButtons extends Window
@Override
public void initialize(Map<String, Object> namespace, URL location, Resources resources) {
- selectButton = (PushButton)namespace.get("selectButton");
+ selectButton = (PushButton) namespace.get("selectButton");
// Get a reference to the button group
- final ButtonGroup numbersGroup = (ButtonGroup)namespace.get("numbers");
+ final ButtonGroup numbersGroup = (ButtonGroup) namespace.get("numbers");
// Add a button press listener
selectButton.getButtonPressListeners().add(new ButtonPressListener() {
@Override
public void buttonPressed(Button button) {
- String message = "You selected \""
- + numbersGroup.getSelection().getButtonData()
+ String message = "You selected \"" + numbersGroup.getSelection().getButtonData()
+ "\".";
Alert.alert(MessageType.INFO, message, RadioButtons.this);
}
Modified: pivot/trunk/tutorials/src/org/apache/pivot/tutorials/bxmlexplorer/BXMLExplorer.java
URL: http://svn.apache.org/viewvc/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/bxmlexplorer/BXMLExplorer.java?rev=1529349&r1=1529348&r2=1529349&view=diff
==============================================================================
--- pivot/trunk/tutorials/src/org/apache/pivot/tutorials/bxmlexplorer/BXMLExplorer.java (original)
+++ pivot/trunk/tutorials/src/org/apache/pivot/tutorials/bxmlexplorer/BXMLExplorer.java Fri Oct 4 23:45:40 2013
@@ -35,11 +35,10 @@ public class BXMLExplorer extends Applic
private BXMLExplorerWindow window = null;
-
@Override
public void startup(Display display, Map<String, String> properties) throws Exception {
BXMLSerializer bxmlSerializer = new BXMLSerializer();
- window = (BXMLExplorerWindow)bxmlSerializer.readObject(BXMLExplorer.class,
+ window = (BXMLExplorerWindow) bxmlSerializer.readObject(BXMLExplorer.class,
"bxml_explorer_window.bxml", true);
window.open(display);
}
@@ -58,8 +57,7 @@ public class BXMLExplorer extends Applic
TextArea body = null;
String bodyText = exception.getMessage();
- if (bodyText != null
- && bodyText.length() > 0) {
+ if (bodyText != null && bodyText.length() > 0) {
body = new TextArea();
body.setText(bodyText);
body.setEditable(false);
@@ -72,4 +70,3 @@ public class BXMLExplorer extends Applic
DesktopApplicationContext.main(BXMLExplorer.class, args);
}
}
-
Modified: pivot/trunk/tutorials/src/org/apache/pivot/tutorials/bxmlexplorer/BXMLExplorerDocument.java
URL: http://svn.apache.org/viewvc/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/bxmlexplorer/BXMLExplorerDocument.java?rev=1529349&r1=1529348&r2=1529349&view=diff
==============================================================================
--- pivot/trunk/tutorials/src/org/apache/pivot/tutorials/bxmlexplorer/BXMLExplorerDocument.java (original)
+++ pivot/trunk/tutorials/src/org/apache/pivot/tutorials/bxmlexplorer/BXMLExplorerDocument.java Fri Oct 4 23:45:40 2013
@@ -125,7 +125,8 @@ public class BXMLExplorerDocument extend
}
@Override
- public void selectedPathsChanged(TreeView treeViewArgument, Sequence<Path> previousSelectedPaths) {
+ public void selectedPathsChanged(TreeView treeViewArgument,
+ Sequence<Path> previousSelectedPaths) {
// if the selection becomes empty, remove the decorator
if (treeViewArgument.getSelectedNode() == null && previousSelectedComponent != null
&& previousSelectedComponent.getDecorators().indexOf(focusDecorator) > -1) {
@@ -166,19 +167,24 @@ public class BXMLExplorerDocument extend
load(file);
} catch (RuntimeException exception) {
exception.printStackTrace();
- BXMLExplorer.displayLoadException(exception, BXMLExplorerDocument.this.getWindow());
+ BXMLExplorer.displayLoadException(exception,
+ BXMLExplorerDocument.this.getWindow());
} catch (IOException exception) {
exception.printStackTrace();
- BXMLExplorer.displayLoadException(exception, BXMLExplorerDocument.this.getWindow());
+ BXMLExplorer.displayLoadException(exception,
+ BXMLExplorerDocument.this.getWindow());
} catch (SerializationException exception) {
exception.printStackTrace();
- BXMLExplorer.displayLoadException(exception, BXMLExplorerDocument.this.getWindow());
+ BXMLExplorer.displayLoadException(exception,
+ BXMLExplorerDocument.this.getWindow());
} catch (ParserConfigurationException exception) {
exception.printStackTrace();
- BXMLExplorer.displayLoadException(exception, BXMLExplorerDocument.this.getWindow());
+ BXMLExplorer.displayLoadException(exception,
+ BXMLExplorerDocument.this.getWindow());
} catch (SAXException exception) {
exception.printStackTrace();
- BXMLExplorer.displayLoadException(exception, BXMLExplorerDocument.this.getWindow());
+ BXMLExplorer.displayLoadException(exception,
+ BXMLExplorerDocument.this.getWindow());
}
}
});
@@ -201,7 +207,8 @@ public class BXMLExplorerDocument extend
return file;
}
- public void load(File f) throws IOException, SerializationException, ParserConfigurationException, SAXException {
+ public void load(File f) throws IOException, SerializationException,
+ ParserConfigurationException, SAXException {
BXMLSerializer serializer = new BXMLSerializer();
serializer.setLocation(f.toURI().toURL());
final FileInputStream in = new FileInputStream(f);
@@ -245,7 +252,8 @@ public class BXMLExplorerDocument extend
@SuppressWarnings("unchecked")
private TreeNode analyseObjectTree(Object container) {
- // We don't want the RowSequence object to show up in the tree, it doesn't look neat
+ // We don't want the RowSequence object to show up in the tree, it
+ // doesn't look neat
if (container instanceof TablePane) {
TreeBranch branch = new TreeBranch(nameForObject(container));
TablePane table = (TablePane) container;
Modified: pivot/trunk/tutorials/src/org/apache/pivot/tutorials/bxmlexplorer/BXMLExplorerWindow.java
URL: http://svn.apache.org/viewvc/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/bxmlexplorer/BXMLExplorerWindow.java?rev=1529349&r1=1529348&r2=1529349&view=diff
==============================================================================
--- pivot/trunk/tutorials/src/org/apache/pivot/tutorials/bxmlexplorer/BXMLExplorerWindow.java (original)
+++ pivot/trunk/tutorials/src/org/apache/pivot/tutorials/bxmlexplorer/BXMLExplorerWindow.java Fri Oct 4 23:45:40 2013
@@ -150,7 +150,8 @@ public class BXMLExplorerWindow extends
}
File f = fileBrowserSheet.getSelectedFile();
- // if we have already loaded the file, select the appropriate tab and return
+ // if we have already loaded the file, select the
+ // appropriate tab and return
int idx = 0;
for (Component comp : tabPane.getTabs()) {
if (f.equals(((BXMLExplorerDocument) comp).getLoadedFile())) {
Modified: pivot/trunk/tutorials/src/org/apache/pivot/tutorials/bxmlexplorer/CreateHighlightedXML.java
URL: http://svn.apache.org/viewvc/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/bxmlexplorer/CreateHighlightedXML.java?rev=1529349&r1=1529348&r2=1529349&view=diff
==============================================================================
--- pivot/trunk/tutorials/src/org/apache/pivot/tutorials/bxmlexplorer/CreateHighlightedXML.java (original)
+++ pivot/trunk/tutorials/src/org/apache/pivot/tutorials/bxmlexplorer/CreateHighlightedXML.java Fri Oct 4 23:45:40 2013
@@ -134,7 +134,6 @@ public class CreateHighlightedXML {
return buf.toString();
}
-
public static final class TestApplication extends Application.Adapter {
private Window window = null;
Modified: pivot/trunk/tutorials/src/org/apache/pivot/tutorials/bxmlexplorer/FakeWindow.java
URL: http://svn.apache.org/viewvc/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/bxmlexplorer/FakeWindow.java?rev=1529349&r1=1529348&r2=1529349&view=diff
==============================================================================
--- pivot/trunk/tutorials/src/org/apache/pivot/tutorials/bxmlexplorer/FakeWindow.java (original)
+++ pivot/trunk/tutorials/src/org/apache/pivot/tutorials/bxmlexplorer/FakeWindow.java Fri Oct 4 23:45:40 2013
@@ -30,8 +30,8 @@ import org.apache.pivot.wtk.WindowListen
import org.apache.pivot.wtk.media.Image;
/**
- * Because we can't render a real Window object inside our container, create a fake window
- * that looks mostly like a real window.
+ * Because we can't render a real Window object inside our container, create a
+ * fake window that looks mostly like a real window.
*/
@DefaultProperty("content")
public class FakeWindow extends Container {
Modified: pivot/trunk/tutorials/src/org/apache/pivot/tutorials/bxmlexplorer/FakeWindowListener.java
URL: http://svn.apache.org/viewvc/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/bxmlexplorer/FakeWindowListener.java?rev=1529349&r1=1529348&r2=1529349&view=diff
==============================================================================
--- pivot/trunk/tutorials/src/org/apache/pivot/tutorials/bxmlexplorer/FakeWindowListener.java (original)
+++ pivot/trunk/tutorials/src/org/apache/pivot/tutorials/bxmlexplorer/FakeWindowListener.java Fri Oct 4 23:45:40 2013
@@ -54,7 +54,7 @@ public interface FakeWindowListener {
/**
* Called when a window's title has changed.
- *
+ *
* @param window
* @param previousTitle
*/
@@ -62,7 +62,7 @@ public interface FakeWindowListener {
/**
* Called when a window's icon has changed.
- *
+ *
* @param window
* @param addedIcon
*/
@@ -70,7 +70,7 @@ public interface FakeWindowListener {
/**
* Called when a window's icon has changed.
- *
+ *
* @param window
* @param addedIcon
*/
@@ -78,7 +78,7 @@ public interface FakeWindowListener {
/**
* Called when a window's icon has changed.
- *
+ *
* @param window
* @param index
* @param removed
@@ -87,7 +87,7 @@ public interface FakeWindowListener {
/**
* Called when a window's content component has changed.
- *
+ *
* @param window
* @param previousContent
*/
Modified: pivot/trunk/tutorials/src/org/apache/pivot/tutorials/bxmlexplorer/FakeWindowSkin.java
URL: http://svn.apache.org/viewvc/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/bxmlexplorer/FakeWindowSkin.java?rev=1529349&r1=1529348&r2=1529349&view=diff
==============================================================================
--- pivot/trunk/tutorials/src/org/apache/pivot/tutorials/bxmlexplorer/FakeWindowSkin.java (original)
+++ pivot/trunk/tutorials/src/org/apache/pivot/tutorials/bxmlexplorer/FakeWindowSkin.java Fri Oct 4 23:45:40 2013
@@ -173,7 +173,8 @@ public class FakeWindowSkin extends Cont
// Derived colors
private Color titleBarBevelColor;
- // private Color contentBevelColor; // TODO: future use
+
+ // private Color contentBevelColor; // TODO: future use
public FakeWindowSkin() {
TerraTheme theme = (TerraTheme) Theme.getTheme();
Modified: pivot/trunk/tutorials/src/org/apache/pivot/tutorials/bxmlexplorer/tools/ComponentInspector.java
URL: http://svn.apache.org/viewvc/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/bxmlexplorer/tools/ComponentInspector.java?rev=1529349&r1=1529348&r2=1529349&view=diff
==============================================================================
--- pivot/trunk/tutorials/src/org/apache/pivot/tutorials/bxmlexplorer/tools/ComponentInspector.java (original)
+++ pivot/trunk/tutorials/src/org/apache/pivot/tutorials/bxmlexplorer/tools/ComponentInspector.java Fri Oct 4 23:45:40 2013
@@ -25,8 +25,8 @@ import org.apache.pivot.wtk.Container;
* component (its "source").
*/
public abstract class ComponentInspector extends Container {
- private static class ComponentInspectorListenerList
- extends ListenerList<ComponentInspectorListener> implements ComponentInspectorListener {
+ private static class ComponentInspectorListenerList extends
+ ListenerList<ComponentInspectorListener> implements ComponentInspectorListener {
@Override
public void sourceChanged(ComponentInspector componentInspector, Component previousSource) {
for (ComponentInspectorListener listener : this) {
@@ -37,8 +37,7 @@ public abstract class ComponentInspector
private Component source = null;
- private ComponentInspectorListenerList componentInspectorListeners =
- new ComponentInspectorListenerList();
+ private ComponentInspectorListenerList componentInspectorListeners = new ComponentInspectorListenerList();
public Component getSource() {
return source;
Modified: pivot/trunk/tutorials/src/org/apache/pivot/tutorials/bxmlexplorer/tools/ComponentInspectorListener.java
URL: http://svn.apache.org/viewvc/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/bxmlexplorer/tools/ComponentInspectorListener.java?rev=1529349&r1=1529348&r2=1529349&view=diff
==============================================================================
--- pivot/trunk/tutorials/src/org/apache/pivot/tutorials/bxmlexplorer/tools/ComponentInspectorListener.java (original)
+++ pivot/trunk/tutorials/src/org/apache/pivot/tutorials/bxmlexplorer/tools/ComponentInspectorListener.java Fri Oct 4 23:45:40 2013
@@ -24,7 +24,7 @@ import org.apache.pivot.wtk.Component;
public interface ComponentInspectorListener {
/**
* Called when an component inspector's source component has changed.
- *
+ *
* @param componentInspector
* @param previousSource
*/