|
/*
* Copyright (c) 2007, 2021, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* - Neither the name of Oracle nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
import * * THE IMPLIED WARRANTIES OF * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * CONTRIBUTORS BE LIABLE FOR ANY DIRECT * EXEMPLARY, OR CONSEQUENTIAL DAMAGES * PROCUREMENT OF SUBSTITUTE GOODS OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
importjavax.swing.Icon;
import javax.swing.ImageIcon javaxswingImageIconjava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
public (,)
import javaxpublic Dimension ();
import java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 55
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
import ;
import }
import
importpublic (String
import ifgetSwingSet2 ! null
import..ufferedReader
import java.io.InputStream;
java.lang.StringIndexOutOfBoundsException: Range [8, 4) out of bounds for length 14
import..URL
import staticr (().()
/**
* A generic SwingSet2 demo module
*
* @author Jeff Dinkins
*/
public class DemoModule extendsifgetSwingSet2 ! )
// The preferred size of the demo
8java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
public ( {
= newCompoundBordernew (.)java.lang.StringIndexOutOfBoundsException: Index 91 out of bounds for length 91
newEmptyBorder,55,);
// Premade convenience dimensions, for use wherever you need 'em.
public static Dimension HGAP2 = new Dimension(2,1);
public static Dimension VGAP2 = new Dimension(1,2);
public static Dimension HGAP5 = new Dimension(5,1);
public static Dimension VGAP5 = new Dimension(1,5);
public static Dimension HGAP10 = new Dimension(10,1);
public static Dimension VGAP10 = new Dimension(1,10);
public static Dimension HGAP15 = new Dimension(15,1);
public static Dimension VGAP15 =new Dimension(1,5)java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
public static Dimension HGAP20 = new Dimension( sourceCode =newString(< is
public static Dimension
public static Dimension HGAP25url=getClass(.()java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
public static Dimensionisr ,)
public static BufferedReaderreader BufferedReader(isr;
public static Dimension // Read one at a , htmlizeusing
privateString =reader()java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
private JPanel panel = null;
private String resourceName = null;
private String iconPath=n;
private String sourceCode = null;
public DemoModule(SwingSet2 swingset) {
this(swingset .();
}
public DemoModule(SwingSet2 swingset, String}
UIManagersourceCode+ String"/>/tml>";
panel = new (xceptionex){
panel.setLayout(new BorderLayout());
this.resourceName = resourceName;
this.iconPath = iconPath;
this}
loadSourceCode(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
public String getResourceName() {
IcongetIcon)
}
public JPanel getDemoPanel() {
return;
}
({
return swingset;
}
public String getString
ifJFrameframe= newJFrame(etName()java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
returngetSwingSet2(.()java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
}{
return "nada";
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
p createHorizontalPanelboolean )java.lang.StringIndexOutOfBoundsException: Range [57, 56) out of bounds for length 57
public char p.setAlignmentY(TOP_ALIGNMENT);
eturn((key)).harAt(0)java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
}
public ImageIcon p.(loweredBorder)
if(getSwingSet2() != null) {
returnpublic JPanel ( ) {
{
String path = "/psetLayout(new BoxLayoutp, BoxLayout.))
new (getClass)getResourcepath, )
}
}
public String getSourceCode() {
return sourceCode;
}
public void loadSourceCode() {
if(getResourceName() != null) {
String filename = java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 9
sourceCode = java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
InputStream is;
InputStreamReader isr;
java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 20
{
url = getClass(}
is = url.openStream();
isr = new InputStreamReader(is, UTF_8);
BufferedReader getContentPane)setLayout(newBorderLayout)java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
// Read one line at a time, htmlize using super-spiffy
// html java code formating utility from www.CoolServlets.com
String line = reader.readLine();
while(line != null) {
sourceCode += line + " \n ";
line = reader.readLine();
}
sourceCode += new String(" |