mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 18:28:00 +00:00
Fixed compatibility with Java 7.
Problem was due to inability to deserialize display_new_layout.xml. I changed that file's default serializer to XStream. This fix maintains compatibility with existing display_new_layout.xml when possible, and uses an XStream-generated display_layout.xml when it cannot parse the former. Note this updates the default display_layout.xml, which looks OK under Windows XP with resolution 1024x768. Bug: 144
This commit is contained in:
@@ -1,519 +1,288 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<org.jdesktop.swingx.MultiSplitLayout_-Split>
|
||||||
<java version="1.6.0_26" class="java.beans.XMLDecoder">
|
<parent>
|
||||||
<object id="MultiSplitLayout$Split0" class="org.jdesktop.swingx.MultiSplitLayout$Split">
|
<bounds>
|
||||||
<void property="bounds">
|
<x>0</x>
|
||||||
<object class="java.awt.Rectangle">
|
<y>0</y>
|
||||||
<int>0</int>
|
<width>0</width>
|
||||||
<int>0</int>
|
<height>0</height>
|
||||||
<int>1024</int>
|
</bounds>
|
||||||
<int>687</int>
|
<weight>0.0</weight>
|
||||||
</object>
|
<isVisible>true</isVisible>
|
||||||
</void>
|
<children>
|
||||||
<void id="ArrayList0" property="children">
|
<org.jdesktop.swingx.MultiSplitLayout_-Split reference="../../.."/>
|
||||||
<void method="add">
|
</children>
|
||||||
<object id="MultiSplitLayout$Split1" class="org.jdesktop.swingx.MultiSplitLayout$Split">
|
<rowLayout>true</rowLayout>
|
||||||
<void property="bounds">
|
</parent>
|
||||||
<object class="java.awt.Rectangle">
|
<bounds>
|
||||||
<int>0</int>
|
<x>0</x>
|
||||||
<int>0</int>
|
<y>0</y>
|
||||||
<int>197</int>
|
<width>1024</width>
|
||||||
<int>687</int>
|
<height>687</height>
|
||||||
</object>
|
</bounds>
|
||||||
</void>
|
<weight>0.0</weight>
|
||||||
<void id="ArrayList1" property="children">
|
<isVisible>true</isVisible>
|
||||||
<void method="add">
|
<children>
|
||||||
<object class="org.jdesktop.swingx.MultiSplitLayout$Leaf">
|
<org.jdesktop.swingx.MultiSplitLayout_-Split>
|
||||||
<void property="bounds">
|
<parent reference="../../.."/>
|
||||||
<object class="java.awt.Rectangle">
|
<bounds>
|
||||||
<int>0</int>
|
<x>0</x>
|
||||||
<int>0</int>
|
<y>0</y>
|
||||||
<int>197</int>
|
<width>197</width>
|
||||||
<int>130</int>
|
<height>687</height>
|
||||||
</object>
|
</bounds>
|
||||||
</void>
|
<weight>0.0</weight>
|
||||||
<void property="name">
|
<isVisible>true</isVisible>
|
||||||
<string>info</string>
|
<children>
|
||||||
</void>
|
<org.jdesktop.swingx.MultiSplitLayout_-Leaf>
|
||||||
<void property="parent">
|
<parent reference="../../.."/>
|
||||||
<object idref="MultiSplitLayout$Split1"/>
|
<bounds>
|
||||||
</void>
|
<x>0</x>
|
||||||
<void property="weight">
|
<y>0</y>
|
||||||
<double>0.2</double>
|
<width>197</width>
|
||||||
</void>
|
<height>126</height>
|
||||||
</object>
|
</bounds>
|
||||||
</void>
|
<weight>0.2</weight>
|
||||||
<void method="add">
|
<isVisible>true</isVisible>
|
||||||
<object class="org.jdesktop.swingx.MultiSplitLayout$Divider">
|
<name>info</name>
|
||||||
<void property="bounds">
|
</org.jdesktop.swingx.MultiSplitLayout_-Leaf>
|
||||||
<object class="java.awt.Rectangle">
|
<org.jdesktop.swingx.MultiSplitLayout_-Divider>
|
||||||
<int>0</int>
|
<parent reference="../../.."/>
|
||||||
<int>130</int>
|
<bounds>
|
||||||
<int>197</int>
|
<x>0</x>
|
||||||
<int>5</int>
|
<y>126</y>
|
||||||
</object>
|
<width>197</width>
|
||||||
</void>
|
<height>5</height>
|
||||||
<void property="parent">
|
</bounds>
|
||||||
<object idref="MultiSplitLayout$Split1"/>
|
<weight>0.0</weight>
|
||||||
</void>
|
<isVisible>true</isVisible>
|
||||||
</object>
|
</org.jdesktop.swingx.MultiSplitLayout_-Divider>
|
||||||
</void>
|
<org.jdesktop.swingx.MultiSplitLayout_-Leaf>
|
||||||
<void method="add">
|
<parent reference="../../.."/>
|
||||||
<object class="org.jdesktop.swingx.MultiSplitLayout$Leaf">
|
<bounds>
|
||||||
<void property="bounds">
|
<x>0</x>
|
||||||
<object class="java.awt.Rectangle">
|
<y>131</y>
|
||||||
<int>0</int>
|
<width>197</width>
|
||||||
<int>135</int>
|
<height>142</height>
|
||||||
<int>197</int>
|
</bounds>
|
||||||
<int>146</int>
|
<weight>0.2</weight>
|
||||||
</object>
|
<isVisible>true</isVisible>
|
||||||
</void>
|
<name>compy</name>
|
||||||
<void property="name">
|
</org.jdesktop.swingx.MultiSplitLayout_-Leaf>
|
||||||
<string>compy</string>
|
<org.jdesktop.swingx.MultiSplitLayout_-Divider>
|
||||||
</void>
|
<parent reference="../../.."/>
|
||||||
<void property="parent">
|
<bounds>
|
||||||
<object idref="MultiSplitLayout$Split1"/>
|
<x>0</x>
|
||||||
</void>
|
<y>273</y>
|
||||||
<void property="weight">
|
<width>197</width>
|
||||||
<double>0.2</double>
|
<height>5</height>
|
||||||
</void>
|
</bounds>
|
||||||
</object>
|
<weight>0.0</weight>
|
||||||
</void>
|
<isVisible>true</isVisible>
|
||||||
<void method="add">
|
</org.jdesktop.swingx.MultiSplitLayout_-Divider>
|
||||||
<object class="org.jdesktop.swingx.MultiSplitLayout$Divider">
|
<org.jdesktop.swingx.MultiSplitLayout_-Leaf>
|
||||||
<void property="bounds">
|
<parent reference="../../.."/>
|
||||||
<object class="java.awt.Rectangle">
|
<bounds>
|
||||||
<int>0</int>
|
<x>0</x>
|
||||||
<int>281</int>
|
<y>278</y>
|
||||||
<int>197</int>
|
<width>197</width>
|
||||||
<int>5</int>
|
<height>115</height>
|
||||||
</object>
|
</bounds>
|
||||||
</void>
|
<weight>0.2</weight>
|
||||||
<void property="parent">
|
<isVisible>true</isVisible>
|
||||||
<object idref="MultiSplitLayout$Split1"/>
|
<name>stack</name>
|
||||||
</void>
|
</org.jdesktop.swingx.MultiSplitLayout_-Leaf>
|
||||||
</object>
|
<org.jdesktop.swingx.MultiSplitLayout_-Divider>
|
||||||
</void>
|
<parent reference="../../.."/>
|
||||||
<void method="add">
|
<bounds>
|
||||||
<object class="org.jdesktop.swingx.MultiSplitLayout$Leaf">
|
<x>0</x>
|
||||||
<void property="bounds">
|
<y>393</y>
|
||||||
<object class="java.awt.Rectangle">
|
<width>197</width>
|
||||||
<int>0</int>
|
<height>5</height>
|
||||||
<int>286</int>
|
</bounds>
|
||||||
<int>197</int>
|
<weight>0.0</weight>
|
||||||
<int>104</int>
|
<isVisible>true</isVisible>
|
||||||
</object>
|
</org.jdesktop.swingx.MultiSplitLayout_-Divider>
|
||||||
</void>
|
<org.jdesktop.swingx.MultiSplitLayout_-Leaf>
|
||||||
<void property="name">
|
<parent reference="../../.."/>
|
||||||
<string>stack</string>
|
<bounds>
|
||||||
</void>
|
<x>0</x>
|
||||||
<void property="parent">
|
<y>398</y>
|
||||||
<object idref="MultiSplitLayout$Split1"/>
|
<width>197</width>
|
||||||
</void>
|
<height>137</height>
|
||||||
<void property="weight">
|
</bounds>
|
||||||
<double>0.2</double>
|
<weight>0.2</weight>
|
||||||
</void>
|
<isVisible>true</isVisible>
|
||||||
</object>
|
<name>combat</name>
|
||||||
</void>
|
</org.jdesktop.swingx.MultiSplitLayout_-Leaf>
|
||||||
<void method="add">
|
<org.jdesktop.swingx.MultiSplitLayout_-Divider>
|
||||||
<object class="org.jdesktop.swingx.MultiSplitLayout$Divider">
|
<parent reference="../../.."/>
|
||||||
<void property="bounds">
|
<bounds>
|
||||||
<object class="java.awt.Rectangle">
|
<x>0</x>
|
||||||
<int>0</int>
|
<y>535</y>
|
||||||
<int>390</int>
|
<width>197</width>
|
||||||
<int>197</int>
|
<height>5</height>
|
||||||
<int>5</int>
|
</bounds>
|
||||||
</object>
|
<weight>0.0</weight>
|
||||||
</void>
|
<isVisible>true</isVisible>
|
||||||
<void property="parent">
|
</org.jdesktop.swingx.MultiSplitLayout_-Divider>
|
||||||
<object idref="MultiSplitLayout$Split1"/>
|
<org.jdesktop.swingx.MultiSplitLayout_-Leaf>
|
||||||
</void>
|
<parent reference="../../.."/>
|
||||||
</object>
|
<bounds>
|
||||||
</void>
|
<x>0</x>
|
||||||
<void method="add">
|
<y>540</y>
|
||||||
<object class="org.jdesktop.swingx.MultiSplitLayout$Leaf">
|
<width>197</width>
|
||||||
<void property="bounds">
|
<height>147</height>
|
||||||
<object class="java.awt.Rectangle">
|
</bounds>
|
||||||
<int>0</int>
|
<weight>0.2</weight>
|
||||||
<int>395</int>
|
<isVisible>true</isVisible>
|
||||||
<int>197</int>
|
<name>human</name>
|
||||||
<int>136</int>
|
</org.jdesktop.swingx.MultiSplitLayout_-Leaf>
|
||||||
</object>
|
</children>
|
||||||
</void>
|
<rowLayout>false</rowLayout>
|
||||||
<void property="name">
|
</org.jdesktop.swingx.MultiSplitLayout_-Split>
|
||||||
<string>combat</string>
|
<org.jdesktop.swingx.MultiSplitLayout_-Divider>
|
||||||
</void>
|
<parent reference="../../.."/>
|
||||||
<void property="parent">
|
<bounds>
|
||||||
<object idref="MultiSplitLayout$Split1"/>
|
<x>197</x>
|
||||||
</void>
|
<y>0</y>
|
||||||
<void property="weight">
|
<width>5</width>
|
||||||
<double>0.2</double>
|
<height>687</height>
|
||||||
</void>
|
</bounds>
|
||||||
</object>
|
<weight>0.0</weight>
|
||||||
</void>
|
<isVisible>true</isVisible>
|
||||||
<void method="add">
|
</org.jdesktop.swingx.MultiSplitLayout_-Divider>
|
||||||
<object class="org.jdesktop.swingx.MultiSplitLayout$Divider">
|
<org.jdesktop.swingx.MultiSplitLayout_-Split>
|
||||||
<void property="bounds">
|
<parent reference="../../.."/>
|
||||||
<object class="java.awt.Rectangle">
|
<bounds>
|
||||||
<int>0</int>
|
<x>202</x>
|
||||||
<int>531</int>
|
<y>0</y>
|
||||||
<int>197</int>
|
<width>678</width>
|
||||||
<int>5</int>
|
<height>687</height>
|
||||||
</object>
|
</bounds>
|
||||||
</void>
|
<weight>1.0</weight>
|
||||||
<void property="parent">
|
<isVisible>true</isVisible>
|
||||||
<object idref="MultiSplitLayout$Split1"/>
|
<children>
|
||||||
</void>
|
<org.jdesktop.swingx.MultiSplitLayout_-Leaf>
|
||||||
</object>
|
<parent reference="../../.."/>
|
||||||
</void>
|
<bounds>
|
||||||
<void method="add">
|
<x>202</x>
|
||||||
<object class="org.jdesktop.swingx.MultiSplitLayout$Leaf">
|
<y>0</y>
|
||||||
<void property="bounds">
|
<width>678</width>
|
||||||
<object class="java.awt.Rectangle">
|
<height>281</height>
|
||||||
<int>0</int>
|
</bounds>
|
||||||
<int>536</int>
|
<weight>0.4</weight>
|
||||||
<int>197</int>
|
<isVisible>true</isVisible>
|
||||||
<int>151</int>
|
<name>compyPlay</name>
|
||||||
</object>
|
</org.jdesktop.swingx.MultiSplitLayout_-Leaf>
|
||||||
</void>
|
<org.jdesktop.swingx.MultiSplitLayout_-Divider>
|
||||||
<void property="name">
|
<parent reference="../../.."/>
|
||||||
<string>human</string>
|
<bounds>
|
||||||
</void>
|
<x>202</x>
|
||||||
<void property="parent">
|
<y>281</y>
|
||||||
<object idref="MultiSplitLayout$Split1"/>
|
<width>678</width>
|
||||||
</void>
|
<height>5</height>
|
||||||
<void property="weight">
|
</bounds>
|
||||||
<double>0.2</double>
|
<weight>0.0</weight>
|
||||||
</void>
|
<isVisible>true</isVisible>
|
||||||
</object>
|
</org.jdesktop.swingx.MultiSplitLayout_-Divider>
|
||||||
</void>
|
<org.jdesktop.swingx.MultiSplitLayout_-Leaf>
|
||||||
</void>
|
<parent reference="../../.."/>
|
||||||
<void property="children">
|
<bounds>
|
||||||
<object idref="ArrayList1"/>
|
<x>202</x>
|
||||||
</void>
|
<y>286</y>
|
||||||
<void property="parent">
|
<width>678</width>
|
||||||
<object idref="MultiSplitLayout$Split0"/>
|
<height>313</height>
|
||||||
</void>
|
</bounds>
|
||||||
<void property="rowLayout">
|
<weight>0.4</weight>
|
||||||
<boolean>false</boolean>
|
<isVisible>true</isVisible>
|
||||||
</void>
|
<name>humanPlay</name>
|
||||||
</object>
|
</org.jdesktop.swingx.MultiSplitLayout_-Leaf>
|
||||||
</void>
|
<org.jdesktop.swingx.MultiSplitLayout_-Divider>
|
||||||
<void method="add">
|
<parent reference="../../.."/>
|
||||||
<object class="org.jdesktop.swingx.MultiSplitLayout$Divider">
|
<bounds>
|
||||||
<void property="bounds">
|
<x>202</x>
|
||||||
<object class="java.awt.Rectangle">
|
<y>599</y>
|
||||||
<int>197</int>
|
<width>678</width>
|
||||||
<int>0</int>
|
<height>5</height>
|
||||||
<int>5</int>
|
</bounds>
|
||||||
<int>687</int>
|
<weight>0.0</weight>
|
||||||
</object>
|
<isVisible>true</isVisible>
|
||||||
</void>
|
</org.jdesktop.swingx.MultiSplitLayout_-Divider>
|
||||||
<void property="parent">
|
<org.jdesktop.swingx.MultiSplitLayout_-Leaf>
|
||||||
<object idref="MultiSplitLayout$Split0"/>
|
<parent reference="../../.."/>
|
||||||
</void>
|
<bounds>
|
||||||
</object>
|
<x>202</x>
|
||||||
</void>
|
<y>604</y>
|
||||||
<void method="add">
|
<width>678</width>
|
||||||
<object id="MultiSplitLayout$Split2" class="org.jdesktop.swingx.MultiSplitLayout$Split">
|
<height>83</height>
|
||||||
<void property="bounds">
|
</bounds>
|
||||||
<object class="java.awt.Rectangle">
|
<weight>0.2</weight>
|
||||||
<int>202</int>
|
<isVisible>true</isVisible>
|
||||||
<int>0</int>
|
<name>humanHand</name>
|
||||||
<int>566</int>
|
</org.jdesktop.swingx.MultiSplitLayout_-Leaf>
|
||||||
<int>687</int>
|
</children>
|
||||||
</object>
|
<rowLayout>false</rowLayout>
|
||||||
</void>
|
</org.jdesktop.swingx.MultiSplitLayout_-Split>
|
||||||
<void id="ArrayList2" property="children">
|
<org.jdesktop.swingx.MultiSplitLayout_-Divider>
|
||||||
<void method="add">
|
<parent reference="../../.."/>
|
||||||
<object class="org.jdesktop.swingx.MultiSplitLayout$Leaf">
|
<bounds>
|
||||||
<void property="bounds">
|
<x>880</x>
|
||||||
<object class="java.awt.Rectangle">
|
<y>0</y>
|
||||||
<int>202</int>
|
<width>5</width>
|
||||||
<int>0</int>
|
<height>687</height>
|
||||||
<int>566</int>
|
</bounds>
|
||||||
<int>1</int>
|
<weight>0.0</weight>
|
||||||
</object>
|
<isVisible>true</isVisible>
|
||||||
</void>
|
</org.jdesktop.swingx.MultiSplitLayout_-Divider>
|
||||||
<void property="name">
|
<org.jdesktop.swingx.MultiSplitLayout_-Split>
|
||||||
<string>compyLand</string>
|
<parent reference="../../.."/>
|
||||||
</void>
|
<bounds>
|
||||||
<void property="parent">
|
<x>885</x>
|
||||||
<object idref="MultiSplitLayout$Split2"/>
|
<y>0</y>
|
||||||
</void>
|
<width>139</width>
|
||||||
<void property="weight">
|
<height>687</height>
|
||||||
<double>0.2</double>
|
</bounds>
|
||||||
</void>
|
<weight>0.0</weight>
|
||||||
</object>
|
<isVisible>true</isVisible>
|
||||||
</void>
|
<children>
|
||||||
<void method="add">
|
<org.jdesktop.swingx.MultiSplitLayout_-Leaf>
|
||||||
<object class="org.jdesktop.swingx.MultiSplitLayout$Divider">
|
<parent reference="../../.."/>
|
||||||
<void property="bounds">
|
<bounds>
|
||||||
<object class="java.awt.Rectangle">
|
<x>885</x>
|
||||||
<int>202</int>
|
<y>0</y>
|
||||||
<int>1</int>
|
<width>139</width>
|
||||||
<int>566</int>
|
<height>496</height>
|
||||||
<int>5</int>
|
</bounds>
|
||||||
</object>
|
<weight>0.5</weight>
|
||||||
</void>
|
<isVisible>true</isVisible>
|
||||||
<void property="parent">
|
<name>detail</name>
|
||||||
<object idref="MultiSplitLayout$Split2"/>
|
</org.jdesktop.swingx.MultiSplitLayout_-Leaf>
|
||||||
</void>
|
<org.jdesktop.swingx.MultiSplitLayout_-Divider>
|
||||||
</object>
|
<parent reference="../../.."/>
|
||||||
</void>
|
<bounds>
|
||||||
<void method="add">
|
<x>885</x>
|
||||||
<object class="org.jdesktop.swingx.MultiSplitLayout$Leaf">
|
<y>496</y>
|
||||||
<void property="bounds">
|
<width>139</width>
|
||||||
<object class="java.awt.Rectangle">
|
<height>5</height>
|
||||||
<int>202</int>
|
</bounds>
|
||||||
<int>6</int>
|
<weight>0.0</weight>
|
||||||
<int>566</int>
|
<isVisible>true</isVisible>
|
||||||
<int>282</int>
|
</org.jdesktop.swingx.MultiSplitLayout_-Divider>
|
||||||
</object>
|
<org.jdesktop.swingx.MultiSplitLayout_-Leaf>
|
||||||
</void>
|
<parent reference="../../.."/>
|
||||||
<void property="name">
|
<bounds>
|
||||||
<string>compyPlay</string>
|
<x>885</x>
|
||||||
</void>
|
<y>501</y>
|
||||||
<void property="parent">
|
<width>139</width>
|
||||||
<object idref="MultiSplitLayout$Split2"/>
|
<height>186</height>
|
||||||
</void>
|
</bounds>
|
||||||
<void property="weight">
|
<weight>0.5</weight>
|
||||||
<double>0.2</double>
|
<isVisible>true</isVisible>
|
||||||
</void>
|
<name>picture</name>
|
||||||
</object>
|
</org.jdesktop.swingx.MultiSplitLayout_-Leaf>
|
||||||
</void>
|
</children>
|
||||||
<void method="add">
|
<rowLayout>false</rowLayout>
|
||||||
<object class="org.jdesktop.swingx.MultiSplitLayout$Divider">
|
</org.jdesktop.swingx.MultiSplitLayout_-Split>
|
||||||
<void property="bounds">
|
</children>
|
||||||
<object class="java.awt.Rectangle">
|
<rowLayout>true</rowLayout>
|
||||||
<int>202</int>
|
</org.jdesktop.swingx.MultiSplitLayout_-Split>
|
||||||
<int>288</int>
|
|
||||||
<int>566</int>
|
|
||||||
<int>5</int>
|
|
||||||
</object>
|
|
||||||
</void>
|
|
||||||
<void property="parent">
|
|
||||||
<object idref="MultiSplitLayout$Split2"/>
|
|
||||||
</void>
|
|
||||||
</object>
|
|
||||||
</void>
|
|
||||||
<void method="add">
|
|
||||||
<object class="org.jdesktop.swingx.MultiSplitLayout$Leaf">
|
|
||||||
<void property="bounds">
|
|
||||||
<object class="java.awt.Rectangle">
|
|
||||||
<int>202</int>
|
|
||||||
<int>293</int>
|
|
||||||
<int>566</int>
|
|
||||||
<int>277</int>
|
|
||||||
</object>
|
|
||||||
</void>
|
|
||||||
<void property="name">
|
|
||||||
<string>humanPlay</string>
|
|
||||||
</void>
|
|
||||||
<void property="parent">
|
|
||||||
<object idref="MultiSplitLayout$Split2"/>
|
|
||||||
</void>
|
|
||||||
<void property="weight">
|
|
||||||
<double>0.2</double>
|
|
||||||
</void>
|
|
||||||
</object>
|
|
||||||
</void>
|
|
||||||
<void method="add">
|
|
||||||
<object class="org.jdesktop.swingx.MultiSplitLayout$Divider">
|
|
||||||
<void property="bounds">
|
|
||||||
<object class="java.awt.Rectangle">
|
|
||||||
<int>202</int>
|
|
||||||
<int>570</int>
|
|
||||||
<int>566</int>
|
|
||||||
<int>5</int>
|
|
||||||
</object>
|
|
||||||
</void>
|
|
||||||
<void property="parent">
|
|
||||||
<object idref="MultiSplitLayout$Split2"/>
|
|
||||||
</void>
|
|
||||||
</object>
|
|
||||||
</void>
|
|
||||||
<void method="add">
|
|
||||||
<object class="org.jdesktop.swingx.MultiSplitLayout$Leaf">
|
|
||||||
<void property="bounds">
|
|
||||||
<object class="java.awt.Rectangle">
|
|
||||||
<int>202</int>
|
|
||||||
<int>575</int>
|
|
||||||
<int>566</int>
|
|
||||||
<int>1</int>
|
|
||||||
</object>
|
|
||||||
</void>
|
|
||||||
<void property="name">
|
|
||||||
<string>humanLand</string>
|
|
||||||
</void>
|
|
||||||
<void property="parent">
|
|
||||||
<object idref="MultiSplitLayout$Split2"/>
|
|
||||||
</void>
|
|
||||||
<void property="weight">
|
|
||||||
<double>0.2</double>
|
|
||||||
</void>
|
|
||||||
</object>
|
|
||||||
</void>
|
|
||||||
<void method="add">
|
|
||||||
<object class="org.jdesktop.swingx.MultiSplitLayout$Divider">
|
|
||||||
<void property="bounds">
|
|
||||||
<object class="java.awt.Rectangle">
|
|
||||||
<int>202</int>
|
|
||||||
<int>576</int>
|
|
||||||
<int>566</int>
|
|
||||||
<int>5</int>
|
|
||||||
</object>
|
|
||||||
</void>
|
|
||||||
<void property="parent">
|
|
||||||
<object idref="MultiSplitLayout$Split2"/>
|
|
||||||
</void>
|
|
||||||
</object>
|
|
||||||
</void>
|
|
||||||
<void method="add">
|
|
||||||
<object class="org.jdesktop.swingx.MultiSplitLayout$Leaf">
|
|
||||||
<void property="bounds">
|
|
||||||
<object class="java.awt.Rectangle">
|
|
||||||
<int>202</int>
|
|
||||||
<int>581</int>
|
|
||||||
<int>566</int>
|
|
||||||
<int>106</int>
|
|
||||||
</object>
|
|
||||||
</void>
|
|
||||||
<void property="name">
|
|
||||||
<string>humanHand</string>
|
|
||||||
</void>
|
|
||||||
<void property="parent">
|
|
||||||
<object idref="MultiSplitLayout$Split2"/>
|
|
||||||
</void>
|
|
||||||
<void property="weight">
|
|
||||||
<double>0.2</double>
|
|
||||||
</void>
|
|
||||||
</object>
|
|
||||||
</void>
|
|
||||||
</void>
|
|
||||||
<void property="children">
|
|
||||||
<object idref="ArrayList2"/>
|
|
||||||
</void>
|
|
||||||
<void property="parent">
|
|
||||||
<object idref="MultiSplitLayout$Split0"/>
|
|
||||||
</void>
|
|
||||||
<void property="rowLayout">
|
|
||||||
<boolean>false</boolean>
|
|
||||||
</void>
|
|
||||||
<void property="weight">
|
|
||||||
<double>1.0</double>
|
|
||||||
</void>
|
|
||||||
</object>
|
|
||||||
</void>
|
|
||||||
<void method="add">
|
|
||||||
<object class="org.jdesktop.swingx.MultiSplitLayout$Divider">
|
|
||||||
<void property="bounds">
|
|
||||||
<object class="java.awt.Rectangle">
|
|
||||||
<int>768</int>
|
|
||||||
<int>0</int>
|
|
||||||
<int>5</int>
|
|
||||||
<int>687</int>
|
|
||||||
</object>
|
|
||||||
</void>
|
|
||||||
<void property="parent">
|
|
||||||
<object idref="MultiSplitLayout$Split0"/>
|
|
||||||
</void>
|
|
||||||
</object>
|
|
||||||
</void>
|
|
||||||
<void method="add">
|
|
||||||
<object id="MultiSplitLayout$Split3" class="org.jdesktop.swingx.MultiSplitLayout$Split">
|
|
||||||
<void property="bounds">
|
|
||||||
<object class="java.awt.Rectangle">
|
|
||||||
<int>773</int>
|
|
||||||
<int>0</int>
|
|
||||||
<int>251</int>
|
|
||||||
<int>687</int>
|
|
||||||
</object>
|
|
||||||
</void>
|
|
||||||
<void id="ArrayList3" property="children">
|
|
||||||
<void method="add">
|
|
||||||
<object class="org.jdesktop.swingx.MultiSplitLayout$Leaf">
|
|
||||||
<void property="bounds">
|
|
||||||
<object class="java.awt.Rectangle">
|
|
||||||
<int>773</int>
|
|
||||||
<int>0</int>
|
|
||||||
<int>251</int>
|
|
||||||
<int>339</int>
|
|
||||||
</object>
|
|
||||||
</void>
|
|
||||||
<void property="name">
|
|
||||||
<string>detail</string>
|
|
||||||
</void>
|
|
||||||
<void property="parent">
|
|
||||||
<object idref="MultiSplitLayout$Split3"/>
|
|
||||||
</void>
|
|
||||||
<void property="weight">
|
|
||||||
<double>0.5</double>
|
|
||||||
</void>
|
|
||||||
</object>
|
|
||||||
</void>
|
|
||||||
<void method="add">
|
|
||||||
<object class="org.jdesktop.swingx.MultiSplitLayout$Divider">
|
|
||||||
<void property="bounds">
|
|
||||||
<object class="java.awt.Rectangle">
|
|
||||||
<int>773</int>
|
|
||||||
<int>339</int>
|
|
||||||
<int>251</int>
|
|
||||||
<int>5</int>
|
|
||||||
</object>
|
|
||||||
</void>
|
|
||||||
<void property="parent">
|
|
||||||
<object idref="MultiSplitLayout$Split3"/>
|
|
||||||
</void>
|
|
||||||
</object>
|
|
||||||
</void>
|
|
||||||
<void method="add">
|
|
||||||
<object class="org.jdesktop.swingx.MultiSplitLayout$Leaf">
|
|
||||||
<void property="bounds">
|
|
||||||
<object class="java.awt.Rectangle">
|
|
||||||
<int>773</int>
|
|
||||||
<int>344</int>
|
|
||||||
<int>251</int>
|
|
||||||
<int>343</int>
|
|
||||||
</object>
|
|
||||||
</void>
|
|
||||||
<void property="name">
|
|
||||||
<string>picture</string>
|
|
||||||
</void>
|
|
||||||
<void property="parent">
|
|
||||||
<object idref="MultiSplitLayout$Split3"/>
|
|
||||||
</void>
|
|
||||||
<void property="weight">
|
|
||||||
<double>0.5</double>
|
|
||||||
</void>
|
|
||||||
</object>
|
|
||||||
</void>
|
|
||||||
</void>
|
|
||||||
<void property="children">
|
|
||||||
<object idref="ArrayList3"/>
|
|
||||||
</void>
|
|
||||||
<void property="parent">
|
|
||||||
<object idref="MultiSplitLayout$Split0"/>
|
|
||||||
</void>
|
|
||||||
<void property="rowLayout">
|
|
||||||
<boolean>false</boolean>
|
|
||||||
</void>
|
|
||||||
</object>
|
|
||||||
</void>
|
|
||||||
</void>
|
|
||||||
<void property="children">
|
|
||||||
<object idref="ArrayList0"/>
|
|
||||||
</void>
|
|
||||||
<void property="parent">
|
|
||||||
<object class="org.jdesktop.swingx.MultiSplitLayout$Split">
|
|
||||||
<void id="ArrayList4" property="children">
|
|
||||||
<void method="add">
|
|
||||||
<object idref="MultiSplitLayout$Split0"/>
|
|
||||||
</void>
|
|
||||||
</void>
|
|
||||||
<void property="children">
|
|
||||||
<object idref="ArrayList4"/>
|
|
||||||
</void>
|
|
||||||
</object>
|
|
||||||
</void>
|
|
||||||
</object>
|
|
||||||
</java>
|
|
||||||
@@ -1,10 +1,78 @@
|
|||||||
package forge;
|
package forge;
|
||||||
|
|
||||||
|
|
||||||
|
import java.awt.BorderLayout;
|
||||||
|
import java.awt.Color;
|
||||||
|
import java.awt.Component;
|
||||||
|
import java.awt.FlowLayout;
|
||||||
|
import java.awt.Font;
|
||||||
|
import java.awt.Frame;
|
||||||
|
import java.awt.GridLayout;
|
||||||
|
import java.awt.Insets;
|
||||||
|
import java.awt.Point;
|
||||||
|
import java.awt.Rectangle;
|
||||||
|
import java.awt.event.ActionEvent;
|
||||||
|
import java.awt.event.ActionListener;
|
||||||
|
import java.awt.event.KeyAdapter;
|
||||||
|
import java.awt.event.KeyEvent;
|
||||||
|
import java.awt.event.MouseAdapter;
|
||||||
|
import java.awt.event.MouseEvent;
|
||||||
|
import java.awt.event.MouseMotionAdapter;
|
||||||
|
import java.awt.event.WindowAdapter;
|
||||||
|
import java.awt.event.WindowEvent;
|
||||||
|
import java.beans.XMLDecoder;
|
||||||
|
import java.io.BufferedInputStream;
|
||||||
|
import java.io.BufferedOutputStream;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
import java.io.FileNotFoundException;
|
||||||
|
import java.io.FileOutputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Observable;
|
||||||
|
import java.util.Observer;
|
||||||
|
|
||||||
|
import javax.swing.Action;
|
||||||
|
import javax.swing.BorderFactory;
|
||||||
|
import javax.swing.ImageIcon;
|
||||||
|
import javax.swing.JButton;
|
||||||
|
import javax.swing.JCheckBoxMenuItem;
|
||||||
|
import javax.swing.JFrame;
|
||||||
|
import javax.swing.JLabel;
|
||||||
|
import javax.swing.JLayeredPane;
|
||||||
|
import javax.swing.JMenu;
|
||||||
|
import javax.swing.JMenuBar;
|
||||||
|
import javax.swing.JMenuItem;
|
||||||
|
import javax.swing.JPanel;
|
||||||
|
import javax.swing.JScrollPane;
|
||||||
|
import javax.swing.JSeparator;
|
||||||
|
import javax.swing.JTextArea;
|
||||||
|
import javax.swing.ScrollPaneConstants;
|
||||||
|
import javax.swing.SwingConstants;
|
||||||
|
import javax.swing.SwingUtilities;
|
||||||
|
import javax.swing.border.Border;
|
||||||
|
import javax.swing.border.EmptyBorder;
|
||||||
|
import javax.swing.border.EtchedBorder;
|
||||||
|
import javax.swing.border.TitledBorder;
|
||||||
|
|
||||||
|
import net.slightlymagic.braids.util.ImmutableIterableFrom;
|
||||||
|
|
||||||
|
import org.jdesktop.swingx.JXMultiSplitPane;
|
||||||
|
import org.jdesktop.swingx.MultiSplitLayout.Node;
|
||||||
|
|
||||||
import arcane.ui.HandArea;
|
import arcane.ui.HandArea;
|
||||||
import arcane.ui.PlayArea;
|
import arcane.ui.PlayArea;
|
||||||
import arcane.ui.ViewPanel;
|
import arcane.ui.ViewPanel;
|
||||||
import arcane.ui.util.Animation;
|
import arcane.ui.util.Animation;
|
||||||
|
|
||||||
|
import com.google.code.jyield.Generator;
|
||||||
|
import com.google.code.jyield.YieldUtils;
|
||||||
|
import com.thoughtworks.xstream.XStream;
|
||||||
|
import com.thoughtworks.xstream.XStreamException;
|
||||||
|
|
||||||
import forge.card.cardFactory.CardFactoryUtil;
|
import forge.card.cardFactory.CardFactoryUtil;
|
||||||
import forge.error.ErrorViewer;
|
import forge.error.ErrorViewer;
|
||||||
import forge.game.GameLossReason;
|
import forge.game.GameLossReason;
|
||||||
@@ -20,28 +88,6 @@ import forge.properties.ForgePreferences;
|
|||||||
import forge.properties.ForgeProps;
|
import forge.properties.ForgeProps;
|
||||||
import forge.properties.NewConstants;
|
import forge.properties.NewConstants;
|
||||||
import forge.view.swing.OldGuiNewGame;
|
import forge.view.swing.OldGuiNewGame;
|
||||||
import net.slightlymagic.braids.util.ImmutableIterableFrom;
|
|
||||||
import org.jdesktop.swingx.JXMultiSplitPane;
|
|
||||||
import org.jdesktop.swingx.MultiSplitLayout.Node;
|
|
||||||
|
|
||||||
import com.google.code.jyield.Generator;
|
|
||||||
import com.google.code.jyield.YieldUtils;
|
|
||||||
|
|
||||||
import javax.swing.*;
|
|
||||||
import javax.swing.border.Border;
|
|
||||||
import javax.swing.border.EmptyBorder;
|
|
||||||
import javax.swing.border.EtchedBorder;
|
|
||||||
import javax.swing.border.TitledBorder;
|
|
||||||
import java.awt.*;
|
|
||||||
import java.awt.Color;
|
|
||||||
import java.awt.event.*;
|
|
||||||
import java.beans.XMLDecoder;
|
|
||||||
import java.beans.XMLEncoder;
|
|
||||||
import java.io.*;
|
|
||||||
import java.util.*;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import static org.jdesktop.swingx.MultiSplitLayout.parseModel;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -752,28 +798,52 @@ public class GuiDisplay4 extends JFrame implements CardContainer, Display, NewCo
|
|||||||
private void initComponents() {
|
private void initComponents() {
|
||||||
//Preparing the Frame
|
//Preparing the Frame
|
||||||
setTitle(ForgeProps.getLocalized(LANG.PROGRAM_NAME));
|
setTitle(ForgeProps.getLocalized(LANG.PROGRAM_NAME));
|
||||||
if (!OldGuiNewGame.useLAFFonts.isSelected()) setFont(new Font("Times New Roman", 0, 16));
|
if (!OldGuiNewGame.useLAFFonts.isSelected()) {
|
||||||
|
setFont(new Font("Times New Roman", 0, 16));
|
||||||
|
}
|
||||||
getContentPane().setLayout(new BorderLayout());
|
getContentPane().setLayout(new BorderLayout());
|
||||||
|
|
||||||
|
// I tried using the JavaBeanConverter with this, but I got a
|
||||||
|
// StackOverflowError due to an infinite loop. The default
|
||||||
|
// XStream format seems just fine, anyway.
|
||||||
|
final XStream xstream = new XStream();
|
||||||
|
|
||||||
|
|
||||||
addWindowListener(new WindowAdapter() {
|
addWindowListener(new WindowAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void windowClosing(WindowEvent evt) {
|
public void windowClosing(final WindowEvent evt) {
|
||||||
concede();
|
concede();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void windowClosed(WindowEvent e) {
|
public void windowClosed(final WindowEvent evt) {
|
||||||
|
|
||||||
// Write the layout to the new file, usually
|
// Write the layout to the new file, usually
|
||||||
// res/gui/display_new_layout.xml
|
// res/gui/display_new_layout.xml
|
||||||
File f = ForgeProps.getFile(LAYOUT_NEW);
|
File f = ForgeProps.getFile(LAYOUT_NEW);
|
||||||
|
|
||||||
Node layout = pane.getMultiSplitLayout().getModel();
|
Node layout = pane.getMultiSplitLayout().getModel();
|
||||||
|
|
||||||
|
BufferedOutputStream out = null;
|
||||||
try {
|
try {
|
||||||
XMLEncoder encoder = new XMLEncoder(new BufferedOutputStream(new FileOutputStream(f)));
|
out = new BufferedOutputStream(new FileOutputStream(f));
|
||||||
encoder.writeObject(layout);
|
xstream.toXML(layout, out);
|
||||||
encoder.close();
|
}
|
||||||
} catch (IOException ex) {
|
catch (IOException ex) {
|
||||||
ex.printStackTrace();
|
assert System.err != null;
|
||||||
|
|
||||||
|
System.err.println("Ignoring exception:");
|
||||||
|
ex.printStackTrace(); // NOPMD by Braids on 8/21/11 9:20 PM
|
||||||
|
System.err.println("-------------------");
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
if (out != null) {
|
||||||
|
try {
|
||||||
|
out.close();
|
||||||
|
} catch (Throwable ignored) { // NOPMD by Braids on 8/21/11 9:20 PM
|
||||||
|
// Ignore failure to close.
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -783,43 +853,95 @@ public class GuiDisplay4 extends JFrame implements CardContainer, Display, NewCo
|
|||||||
|
|
||||||
// Try to load the latest saved layout, usually
|
// Try to load the latest saved layout, usually
|
||||||
// res/gui/display_new_layout.xml
|
// res/gui/display_new_layout.xml
|
||||||
File f = ForgeProps.getFile(LAYOUT_NEW);
|
final File file = ForgeProps.getFile(LAYOUT_NEW);
|
||||||
|
|
||||||
// If the new file does not exist, read the configuration from the
|
|
||||||
// default layout, usually res/gui/display_layout.xml
|
|
||||||
if (!f.exists()) {
|
|
||||||
f = ForgeProps.getFile(LAYOUT);
|
|
||||||
}
|
|
||||||
try {
|
try {
|
||||||
XMLDecoder decoder = new XMLDecoder(new BufferedInputStream(new FileInputStream(f)));
|
model = loadModel(xstream, file);
|
||||||
model = (Node) decoder.readObject();
|
|
||||||
decoder.close();
|
|
||||||
pane.getMultiSplitLayout().setModel(model);
|
|
||||||
//pane.getMultiSplitLayout().setFloatingDividers(false);
|
|
||||||
} catch (Exception ex) {
|
|
||||||
model = parseModel(""//
|
|
||||||
+ "(ROW "//
|
|
||||||
+ "(COLUMN"//
|
|
||||||
+ " (LEAF weight=0.2 name=info)"//
|
|
||||||
+ " (LEAF weight=0.2 name=compy)"//
|
|
||||||
+ " (LEAF weight=0.2 name=stack)"//
|
|
||||||
+ " (LEAF weight=0.2 name=combat)"//
|
|
||||||
+ " (LEAF weight=0.2 name=human)) "//
|
|
||||||
+ "(COLUMN weight=1"//
|
|
||||||
+ " (LEAF weight=0.4 name=compyPlay)"//
|
|
||||||
+ " (LEAF weight=0.4 name=humanPlay)"//
|
|
||||||
+ " (LEAF weight=0.2 name=humanHand)) "//
|
|
||||||
+ "(COLUMN"//
|
|
||||||
+ " (LEAF weight=0.5 name=detail)"//
|
|
||||||
+ " (LEAF weight=0.5 name=picture)))");
|
|
||||||
pane.setModel(model);
|
|
||||||
}
|
}
|
||||||
|
catch (XStreamException xse) {
|
||||||
|
assert System.err != null;
|
||||||
|
|
||||||
|
System.err.println("Error loading '" + file.getAbsolutePath() + "' using XStream: "
|
||||||
|
+ xse.getLocalizedMessage());
|
||||||
|
|
||||||
|
model = null;
|
||||||
|
}
|
||||||
|
catch (FileNotFoundException e1) {
|
||||||
|
model = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (model == null) {
|
||||||
|
assert System.err != null;
|
||||||
|
|
||||||
|
System.err.println("Unable to parse file '" + file.getAbsolutePath()
|
||||||
|
+ "' with XStream; trying XMLDecoder.");
|
||||||
|
|
||||||
|
try {
|
||||||
|
model = loadModelUsingXMLDecoder(file);
|
||||||
|
}
|
||||||
|
catch (FileNotFoundException e1) {
|
||||||
|
model = null;
|
||||||
|
}
|
||||||
|
catch (Throwable exn) { // NOPMD by Braids on 8/21/11 9:20 PM
|
||||||
|
System.err.println("Ignoring exception:");
|
||||||
|
exn.printStackTrace(); // NOPMD by Braids on 8/21/11 9:20 PM
|
||||||
|
System.err.println("-------------------");
|
||||||
|
|
||||||
|
model = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (model == null) {
|
||||||
|
System.err.println("XMLDecoder failed; using default layout.");
|
||||||
|
final File defaultFile = ForgeProps.getFile(LAYOUT);
|
||||||
|
|
||||||
|
try {
|
||||||
|
model = loadModel(xstream, defaultFile);
|
||||||
|
}
|
||||||
|
catch (Exception exn) {
|
||||||
|
// Should never happen.
|
||||||
|
throw new RuntimeException(exn); // NOPMD by Braids on 8/21/11 9:18 PM
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This code is useful for bootstrapping a display_new_layout.xml file.
|
||||||
|
*
|
||||||
|
System.err.println("Unable to parse file '" + defaultFile.getAbsolutePath()
|
||||||
|
+ "' with XStream; using hard coded defaults.");
|
||||||
|
|
||||||
|
model = parseModel(""//
|
||||||
|
+ "(ROW "//
|
||||||
|
+ "(COLUMN"//
|
||||||
|
+ " (LEAF weight=0.2 name=info)"//
|
||||||
|
+ " (LEAF weight=0.2 name=compy)"//
|
||||||
|
+ " (LEAF weight=0.2 name=stack)"//
|
||||||
|
+ " (LEAF weight=0.2 name=combat)"//
|
||||||
|
+ " (LEAF weight=0.2 name=human)) "//
|
||||||
|
+ "(COLUMN weight=1"//
|
||||||
|
+ " (LEAF weight=0.4 name=compyPlay)"//
|
||||||
|
+ " (LEAF weight=0.4 name=humanPlay)"//
|
||||||
|
+ " (LEAF weight=0.2 name=humanHand)) "//
|
||||||
|
+ "(COLUMN"//
|
||||||
|
+ " (LEAF weight=0.5 name=detail)"//
|
||||||
|
+ " (LEAF weight=0.5 name=picture)))");
|
||||||
|
|
||||||
|
pane.setModel(model);
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (model != null) {
|
||||||
|
pane.getMultiSplitLayout().setModel(model);
|
||||||
|
}
|
||||||
|
|
||||||
pane.getMultiSplitLayout().setFloatingDividers(false);
|
pane.getMultiSplitLayout().setFloatingDividers(false);
|
||||||
getContentPane().add(pane);
|
getContentPane().add(pane);
|
||||||
|
|
||||||
//adding the individual parts
|
//adding the individual parts
|
||||||
|
|
||||||
if (!OldGuiNewGame.useLAFFonts.isSelected()) initFonts(pane);
|
if (!OldGuiNewGame.useLAFFonts.isSelected()) {
|
||||||
|
initFonts(pane);
|
||||||
|
}
|
||||||
|
|
||||||
initMsgYesNo(pane);
|
initMsgYesNo(pane);
|
||||||
initOpp(pane);
|
initOpp(pane);
|
||||||
@@ -829,6 +951,75 @@ public class GuiDisplay4 extends JFrame implements CardContainer, Display, NewCo
|
|||||||
initCardPicture(pane);
|
initCardPicture(pane);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Load the panel size preferences from a the given file using XStream.
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* throws XStreamException if there was a parsing error
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @param xstream the XStream parser to use; do not use JavaBeanConverter!
|
||||||
|
* @param file the XML file containing the preferences
|
||||||
|
* @return the preferences model as a Node instance
|
||||||
|
* @throws FileNotFoundException if file does not exist
|
||||||
|
*/
|
||||||
|
public static Node loadModel(final XStream xstream, final File file) throws FileNotFoundException
|
||||||
|
{
|
||||||
|
BufferedInputStream bufferedIn = null;
|
||||||
|
Node model = null;
|
||||||
|
try {
|
||||||
|
bufferedIn = new BufferedInputStream(new FileInputStream(file));
|
||||||
|
model = (Node) xstream.fromXML(bufferedIn);
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
try {
|
||||||
|
if (bufferedIn != null) {
|
||||||
|
bufferedIn.close();
|
||||||
|
}
|
||||||
|
} catch (Throwable ignored) { // NOPMD by Braids on 8/21/11 9:20 PM
|
||||||
|
// Ignore exceptions on close.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return model;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Load the panel size preferences from a the given file using the old
|
||||||
|
* XMLDecoder format. XStream is preferred.
|
||||||
|
*
|
||||||
|
* @param file the XML file containing the preferences
|
||||||
|
* @return the preferences model as a Node instance
|
||||||
|
* @throws FileNotFoundException if file does not exist
|
||||||
|
*/
|
||||||
|
public static Node loadModelUsingXMLDecoder(final File file) throws FileNotFoundException {
|
||||||
|
BufferedInputStream bufferedIn = null;
|
||||||
|
Node model = null;
|
||||||
|
XMLDecoder decoder = null;
|
||||||
|
try {
|
||||||
|
bufferedIn = new BufferedInputStream(new FileInputStream(file));
|
||||||
|
decoder = new XMLDecoder(bufferedIn);
|
||||||
|
model = (Node) decoder.readObject();
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
try {
|
||||||
|
if (decoder != null) {
|
||||||
|
decoder.close();
|
||||||
|
}
|
||||||
|
} catch (Throwable ignored) { // NOPMD by Braids on 8/21/11 9:20 PM
|
||||||
|
// Ignore exceptions on close.
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
if (bufferedIn != null) {
|
||||||
|
bufferedIn.close();
|
||||||
|
}
|
||||||
|
} catch (Throwable ignored) { // NOPMD by Braids on 8/21/11 9:20 PM
|
||||||
|
// Ignore exceptions on close.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return model;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>initFonts.</p>
|
* <p>initFonts.</p>
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user