Skip to content

Commit 95ec4eb

Browse files
committed
Two new GUI shortcuts. ESC will minimize the main Window and Shift+
arrows up and down will change window size.
1 parent 5c0bf52 commit 95ec4eb

4 files changed

Lines changed: 171 additions & 19 deletions

File tree

nbproject/project.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ javac.test.processorpath=\
5757
javadoc.additionalparam=
5858
javadoc.author=false
5959
javadoc.encoding=${source.encoding}
60+
javadoc.html5=false
6061
javadoc.noindex=false
6162
javadoc.nonavbar=false
6263
javadoc.notree=false
@@ -65,6 +66,8 @@ javadoc.splitindex=true
6566
javadoc.use=true
6667
javadoc.version=false
6768
javadoc.windowtitle=
69+
jlink.launcher=false
70+
jlink.launcher.name=ComputerSupportedClassHelper
6871
main.class=br.com.davidbuzatto.computersupportedclasshelper.Main
6972
manifest.file=manifest.mf
7073
meta.inf.dir=${src.dir}/META-INF

src/br/com/davidbuzatto/computersupportedclasshelper/gui/HelpAndAboutDialog.form

Lines changed: 79 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1042,8 +1042,11 @@
10421042
<Layout>
10431043
<DimensionLayout dim="0">
10441044
<Group type="103" groupAlignment="0" attributes="0">
1045-
<Group type="102" attributes="0">
1046-
<Group type="103" groupAlignment="0" attributes="0">
1045+
<Group type="102" alignment="0" attributes="0">
1046+
<Group type="103" groupAlignment="1" attributes="0">
1047+
<Component id="jLabel86" min="-2" max="-2" attributes="0"/>
1048+
<Component id="jLabel54" min="-2" max="-2" attributes="0"/>
1049+
<Component id="jLabel52" min="-2" max="-2" attributes="0"/>
10471050
<Component id="jLabel64" alignment="1" min="-2" max="-2" attributes="0"/>
10481051
<Component id="jLabel67" alignment="1" min="-2" max="-2" attributes="0"/>
10491052
<Component id="jLabel71" alignment="1" min="-2" max="-2" attributes="0"/>
@@ -1069,6 +1072,9 @@
10691072
<EmptySpace max="-2" attributes="0"/>
10701073
<Component id="jLabel66" min="-2" max="-2" attributes="0"/>
10711074
</Group>
1075+
<Component id="jLabel53" min="-2" max="-2" attributes="0"/>
1076+
<Component id="jLabel89" min="-2" max="-2" attributes="0"/>
1077+
<Component id="jLabel91" min="-2" max="-2" attributes="0"/>
10721078
</Group>
10731079
<EmptySpace min="-2" pref="8" max="-2" attributes="0"/>
10741080
</Group>
@@ -1124,7 +1130,21 @@
11241130
<Component id="jLabel88" alignment="3" min="-2" max="-2" attributes="0"/>
11251131
<Component id="jLabel90" alignment="3" min="-2" max="-2" attributes="0"/>
11261132
</Group>
1133+
<EmptySpace max="-2" attributes="0"/>
1134+
<Group type="103" groupAlignment="3" attributes="0">
1135+
<Component id="jLabel52" alignment="3" min="-2" max="-2" attributes="0"/>
1136+
<Component id="jLabel53" alignment="3" min="-2" max="-2" attributes="0"/>
1137+
</Group>
1138+
<EmptySpace max="-2" attributes="0"/>
1139+
<Group type="103" groupAlignment="3" attributes="0">
1140+
<Component id="jLabel54" alignment="3" min="-2" max="-2" attributes="0"/>
1141+
<Component id="jLabel89" alignment="3" min="-2" max="-2" attributes="0"/>
1142+
</Group>
11271143
<EmptySpace max="32767" attributes="0"/>
1144+
<Group type="103" groupAlignment="3" attributes="0">
1145+
<Component id="jLabel86" alignment="3" min="-2" max="-2" attributes="0"/>
1146+
<Component id="jLabel91" alignment="3" min="-2" max="-2" attributes="0"/>
1147+
</Group>
11281148
</Group>
11291149
</Group>
11301150
</DimensionLayout>
@@ -1308,6 +1328,63 @@
13081328
<Property name="text" type="java.lang.String" value="Shift+Esc"/>
13091329
</Properties>
13101330
</Component>
1331+
<Component class="javax.swing.JLabel" name="jLabel52">
1332+
<Properties>
1333+
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
1334+
<Color blue="cc" green="cc" red="cc" type="rgb"/>
1335+
</Property>
1336+
<Property name="text" type="java.lang.String" value="Minimize"/>
1337+
</Properties>
1338+
</Component>
1339+
<Component class="javax.swing.JLabel" name="jLabel53">
1340+
<Properties>
1341+
<Property name="font" type="java.awt.Font" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
1342+
<Connection code="new Font( &quot;Dialog&quot;, Font.BOLD, 12 )" type="code"/>
1343+
</Property>
1344+
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
1345+
<Color blue="cc" green="cc" red="cc" type="rgb"/>
1346+
</Property>
1347+
<Property name="text" type="java.lang.String" value="Esc"/>
1348+
</Properties>
1349+
</Component>
1350+
<Component class="javax.swing.JLabel" name="jLabel54">
1351+
<Properties>
1352+
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
1353+
<Color blue="cc" green="cc" red="cc" type="rgb"/>
1354+
</Property>
1355+
<Property name="text" type="java.lang.String" value="Increase Window Height"/>
1356+
</Properties>
1357+
</Component>
1358+
<Component class="javax.swing.JLabel" name="jLabel86">
1359+
<Properties>
1360+
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
1361+
<Color blue="cc" green="cc" red="cc" type="rgb"/>
1362+
</Property>
1363+
<Property name="text" type="java.lang.String" value="Decrease Window Height"/>
1364+
</Properties>
1365+
</Component>
1366+
<Component class="javax.swing.JLabel" name="jLabel89">
1367+
<Properties>
1368+
<Property name="font" type="java.awt.Font" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
1369+
<Connection code="new Font( &quot;Dialog&quot;, Font.BOLD, 12 )" type="code"/>
1370+
</Property>
1371+
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
1372+
<Color blue="cc" green="cc" red="cc" type="rgb"/>
1373+
</Property>
1374+
<Property name="text" type="java.lang.String" value="Shift+Down arrow"/>
1375+
</Properties>
1376+
</Component>
1377+
<Component class="javax.swing.JLabel" name="jLabel91">
1378+
<Properties>
1379+
<Property name="font" type="java.awt.Font" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
1380+
<Connection code="new Font( &quot;Dialog&quot;, Font.BOLD, 12 )" type="code"/>
1381+
</Property>
1382+
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
1383+
<Color blue="cc" green="cc" red="cc" type="rgb"/>
1384+
</Property>
1385+
<Property name="text" type="java.lang.String" value="Shift+Up arrow"/>
1386+
</Properties>
1387+
</Component>
13111388
</SubComponents>
13121389
</Container>
13131390
</SubComponents>

src/br/com/davidbuzatto/computersupportedclasshelper/gui/HelpAndAboutDialog.java

Lines changed: 63 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public HelpAndAboutDialog( java.awt.Frame parent, boolean modal ) {
3838

3939
lblAbout.setText( "<html>CSCH (Computer Supported Class Helper) is being developed "
4040
+ "as a non profit hobby and for personal use by professor "
41-
+ "David Buzatto from IFSP, São Paulo, Brazil. Use it at your own risk. Version 1.0.</html>" );
41+
+ "David Buzatto from IFSP, São Paulo, Brazil. Use it at your own risk. Version 1.2.</html>" );
4242

4343
keyEventDispatcher = new KeyEventDispatcher() {
4444
@Override
@@ -165,6 +165,12 @@ private void initComponents() {
165165
jLabel87 = new javax.swing.JLabel();
166166
jLabel88 = new javax.swing.JLabel();
167167
jLabel90 = new javax.swing.JLabel();
168+
jLabel52 = new javax.swing.JLabel();
169+
jLabel53 = new javax.swing.JLabel();
170+
jLabel54 = new javax.swing.JLabel();
171+
jLabel86 = new javax.swing.JLabel();
172+
jLabel89 = new javax.swing.JLabel();
173+
jLabel91 = new javax.swing.JLabel();
168174
customDialogContainerPanel2 = new br.com.davidbuzatto.computersupportedclasshelper.gui.CustomDialogContainerPanel();
169175
lblTitle2 = new javax.swing.JLabel();
170176
lblAbout = new javax.swing.JLabel();
@@ -698,21 +704,45 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
698704
jLabel90.setForeground(new java.awt.Color(204, 204, 204));
699705
jLabel90.setText("Shift+Esc");
700706

707+
jLabel52.setForeground(new java.awt.Color(204, 204, 204));
708+
jLabel52.setText("Minimize");
709+
710+
jLabel53.setFont(new Font( "Dialog", Font.BOLD, 12 ));
711+
jLabel53.setForeground(new java.awt.Color(204, 204, 204));
712+
jLabel53.setText("Esc");
713+
714+
jLabel54.setForeground(new java.awt.Color(204, 204, 204));
715+
jLabel54.setText("Increase Window Height");
716+
717+
jLabel86.setForeground(new java.awt.Color(204, 204, 204));
718+
jLabel86.setText("Decrease Window Height");
719+
720+
jLabel89.setFont(new Font( "Dialog", Font.BOLD, 12 ));
721+
jLabel89.setForeground(new java.awt.Color(204, 204, 204));
722+
jLabel89.setText("Shift+Down arrow");
723+
724+
jLabel91.setFont(new Font( "Dialog", Font.BOLD, 12 ));
725+
jLabel91.setForeground(new java.awt.Color(204, 204, 204));
726+
jLabel91.setText("Shift+Up arrow");
727+
701728
javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
702729
jPanel4.setLayout(jPanel4Layout);
703730
jPanel4Layout.setHorizontalGroup(
704731
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
705732
.addGroup(jPanel4Layout.createSequentialGroup()
706-
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
707-
.addComponent(jLabel64, javax.swing.GroupLayout.Alignment.TRAILING)
708-
.addComponent(jLabel67, javax.swing.GroupLayout.Alignment.TRAILING)
709-
.addComponent(jLabel71, javax.swing.GroupLayout.Alignment.TRAILING)
710-
.addComponent(jLabel73, javax.swing.GroupLayout.Alignment.TRAILING)
711-
.addComponent(jLabel77, javax.swing.GroupLayout.Alignment.TRAILING)
712-
.addComponent(jLabel79, javax.swing.GroupLayout.Alignment.TRAILING)
713-
.addComponent(jLabel82, javax.swing.GroupLayout.Alignment.TRAILING)
714-
.addComponent(jLabel85, javax.swing.GroupLayout.Alignment.TRAILING)
715-
.addComponent(jLabel88, javax.swing.GroupLayout.Alignment.TRAILING))
733+
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
734+
.addComponent(jLabel86)
735+
.addComponent(jLabel54)
736+
.addComponent(jLabel52)
737+
.addComponent(jLabel64)
738+
.addComponent(jLabel67)
739+
.addComponent(jLabel71)
740+
.addComponent(jLabel73)
741+
.addComponent(jLabel77)
742+
.addComponent(jLabel79)
743+
.addComponent(jLabel82)
744+
.addComponent(jLabel85)
745+
.addComponent(jLabel88))
716746
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
717747
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
718748
.addComponent(jLabel69)
@@ -726,7 +756,10 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
726756
.addGroup(jPanel4Layout.createSequentialGroup()
727757
.addComponent(jLabel65)
728758
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
729-
.addComponent(jLabel66)))
759+
.addComponent(jLabel66))
760+
.addComponent(jLabel53)
761+
.addComponent(jLabel89)
762+
.addComponent(jLabel91))
730763
.addGap(8, 8, 8))
731764
);
732765
jPanel4Layout.setVerticalGroup(
@@ -769,7 +802,18 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
769802
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
770803
.addComponent(jLabel88)
771804
.addComponent(jLabel90))
772-
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
805+
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
806+
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
807+
.addComponent(jLabel52)
808+
.addComponent(jLabel53))
809+
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
810+
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
811+
.addComponent(jLabel54)
812+
.addComponent(jLabel89))
813+
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
814+
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
815+
.addComponent(jLabel86)
816+
.addComponent(jLabel91)))
773817
);
774818

775819
javax.swing.GroupLayout customDialogContainerPanel1Layout = new javax.swing.GroupLayout(customDialogContainerPanel1);
@@ -934,6 +978,9 @@ public void dispose() {
934978
private javax.swing.JLabel jLabel5;
935979
private javax.swing.JLabel jLabel50;
936980
private javax.swing.JLabel jLabel51;
981+
private javax.swing.JLabel jLabel52;
982+
private javax.swing.JLabel jLabel53;
983+
private javax.swing.JLabel jLabel54;
937984
private javax.swing.JLabel jLabel55;
938985
private javax.swing.JLabel jLabel56;
939986
private javax.swing.JLabel jLabel57;
@@ -968,10 +1015,13 @@ public void dispose() {
9681015
private javax.swing.JLabel jLabel83;
9691016
private javax.swing.JLabel jLabel84;
9701017
private javax.swing.JLabel jLabel85;
1018+
private javax.swing.JLabel jLabel86;
9711019
private javax.swing.JLabel jLabel87;
9721020
private javax.swing.JLabel jLabel88;
1021+
private javax.swing.JLabel jLabel89;
9731022
private javax.swing.JLabel jLabel9;
9741023
private javax.swing.JLabel jLabel90;
1024+
private javax.swing.JLabel jLabel91;
9751025
private javax.swing.JPanel jPanel1;
9761026
private javax.swing.JPanel jPanel2;
9771027
private javax.swing.JPanel jPanel3;

src/br/com/davidbuzatto/computersupportedclasshelper/gui/MainWindow.java

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,12 @@
2020
import java.awt.Component;
2121
import java.awt.Dimension;
2222
import java.awt.Font;
23-
import java.awt.Frame;
2423
import java.awt.HeadlessException;
2524
import java.awt.KeyEventDispatcher;
2625
import java.awt.KeyboardFocusManager;
2726
import java.awt.Point;
2827
import java.awt.Robot;
2928
import java.awt.Toolkit;
30-
import java.awt.Window;
3129
import java.awt.event.ActionEvent;
3230
import java.awt.event.ActionListener;
3331
import java.awt.event.KeyEvent;
@@ -87,7 +85,9 @@ public MainWindow( DrawingConfigs dConfig ) {
8785
KeyboardFocusManager manager = KeyboardFocusManager.getCurrentKeyboardFocusManager();
8886
manager.addKeyEventDispatcher( new ApplicationKeyEventDispatcher( this ) );
8987

90-
setExtendedState( Frame.MAXIMIZED_BOTH );
88+
//setExtendedState( Frame.MAXIMIZED_BOTH );
89+
setSize( Toolkit.getDefaultToolkit().getScreenSize() );
90+
setBounds( 0, 0, getWidth(), getHeight() );
9191

9292
}
9393

@@ -1909,7 +1909,11 @@ public boolean dispatchKeyEvent( KeyEvent e ) {
19091909
} else {
19101910

19111911
switch ( e.getKeyCode() ) {
1912-
1912+
1913+
case KeyEvent.VK_ESCAPE:
1914+
setState( JFrame.ICONIFIED );
1915+
break;
1916+
19131917
case KeyEvent.VK_RIGHT:
19141918

19151919
if ( drawPanel.willCreateNewDrawPage() ) {
@@ -2064,6 +2068,24 @@ public boolean dispatchKeyEvent( KeyEvent e ) {
20642068

20652069
}
20662070

2071+
} else if ( e.getID() == KeyEvent.KEY_PRESSED ) {
2072+
2073+
if ( e.isShiftDown() ) {
2074+
2075+
switch ( e.getKeyCode() ) {
2076+
2077+
case KeyEvent.VK_UP:
2078+
setBounds( 0, 0, getWidth(), getHeight() - 1 );
2079+
break;
2080+
2081+
case KeyEvent.VK_DOWN:
2082+
setBounds( 0, 0, getWidth(), getHeight() + 1 );
2083+
break;
2084+
2085+
}
2086+
2087+
}
2088+
20672089
}
20682090

20692091
}

0 commit comments

Comments
 (0)