@ -18,6 +18,8 @@ public final class AngelFontVisualPanel2 extends JPanel {
int letterSpacing = 0 ;
String fileName = "" ;
int style = Font . PLAIN ;
int charRangeStart = 0 ;
int charRangeEnd = 256 ;
/** Creates new form AngelFontVisualPanel2 */
public AngelFontVisualPanel2 ( ) {
@ -26,7 +28,6 @@ public final class AngelFontVisualPanel2 extends JPanel {
jComboBox1 . addItem ( "PLAIN" ) ;
jComboBox1 . addItem ( "ITALIC" ) ;
jComboBox1 . addItem ( "BOLD" ) ;
}
@Override
@ -46,7 +47,7 @@ public final class AngelFontVisualPanel2 extends JPanel {
}
private void updateFont ( ) {
jLabel3 . setIcon ( new ImageIcon ( FontCreator . buildFont ( fontName , getFileName ( ) , imageSize , fontSize , style , paddingX , paddingY , letterSpacing , true ) . getImage ( ) ) ) ;
jLabel3 . setIcon ( new ImageIcon ( FontCreator . buildFont ( fontName , getFileName ( ) , imageSize , fontSize , style , paddingX , paddingY , letterSpacing , charRangeStart , charRangeEnd , true ) . getImage ( ) ) ) ;
jLabel3 . repaint ( ) ;
jPanel1 . repaint ( ) ;
}
@ -81,6 +82,10 @@ public final class AngelFontVisualPanel2 extends JPanel {
jLabel10 = new javax . swing . JLabel ( ) ;
jLabel11 = new javax . swing . JLabel ( ) ;
jSpinner5 = new javax . swing . JSpinner ( ) ;
jLabel12 = new javax . swing . JLabel ( ) ;
jSpinner6 = new javax . swing . JSpinner ( ) ;
jLabel13 = new javax . swing . JLabel ( ) ;
jSpinner7 = new javax . swing . JSpinner ( ) ;
org . openide . awt . Mnemonics . setLocalizedText ( jButton1 , org . openide . util . NbBundle . getMessage ( AngelFontVisualPanel2 . class , "AngelFontVisualPanel2.jButton1.text" ) ) ; // NOI18N
@ -147,14 +152,12 @@ public final class AngelFontVisualPanel2 extends JPanel {
. addComponent ( jLabel5 )
. addComponent ( jLabel4 , javax . swing . GroupLayout . PREFERRED_SIZE , 52 , javax . swing . GroupLayout . PREFERRED_SIZE ) )
. addGroup ( jPanel2Layout . createParallelGroup ( javax . swing . GroupLayout . Alignment . TRAILING )
. addComponent ( jSpinner3 , javax . swing . GroupLayout . DEFAULT_SIZE , 156 , Short . MAX_VALUE )
. addGroup ( jPanel2Layout . createParallelGroup ( javax . swing . GroupLayout . Alignment . LEADING , false )
. addComponent ( jSpinner2 )
. addComponent ( jTextField1 , javax . swing . GroupLayout . Alignment . TRAILING , javax . swing . GroupLayout . DEFAULT_SIZE , 156 , Short . MAX_VALUE ) )
. addComponent ( jSpinner4 , javax . swing . GroupLayout . DEFAULT_SIZE , 156 , Short . MAX_VALUE ) )
. addComponent ( jSpinner3 )
. addComponent ( jSpinner4 )
. addComponent ( jSpinner2 )
. addComponent ( jTextField1 , javax . swing . GroupLayout . DEFAULT_SIZE , 188 , Short . MAX_VALUE ) )
. addPreferredGap ( javax . swing . LayoutStyle . ComponentPlacement . RELATED )
. addComponent ( jLabel8 )
. addGap ( 45 , 45 , 45 ) )
. addComponent ( jLabel8 ) )
) ;
jPanel2Layout . setVerticalGroup (
jPanel2Layout . createParallelGroup ( javax . swing . GroupLayout . Alignment . LEADING )
@ -213,23 +216,57 @@ public final class AngelFontVisualPanel2 extends JPanel {
}
} ) ;
org . openide . awt . Mnemonics . setLocalizedText ( jLabel12 , org . openide . util . NbBundle . getMessage ( AngelFontVisualPanel2 . class , "AngelFontVisualPanel2.jLabel12.text" ) ) ; // NOI18N
jSpinner6 . setModel ( new javax . swing . SpinnerNumberModel ( 0 , 0 , 65535 , 32 ) ) ;
jSpinner6 . setToolTipText ( org . openide . util . NbBundle . getMessage ( AngelFontVisualPanel2 . class , "AngelFontVisualPanel2.jSpinner6.toolTipText" ) ) ; // NOI18N
jSpinner6 . addChangeListener ( new javax . swing . event . ChangeListener ( ) {
public void stateChanged ( javax . swing . event . ChangeEvent evt ) {
jSpinner6letterSpacingUpdate ( evt ) ;
}
} ) ;
org . openide . awt . Mnemonics . setLocalizedText ( jLabel13 , org . openide . util . NbBundle . getMessage ( AngelFontVisualPanel2 . class , "AngelFontVisualPanel2.jLabel13.text" ) ) ; // NOI18N
jSpinner7 . setModel ( new javax . swing . SpinnerNumberModel ( 256 , 0 , 65535 , 32 ) ) ;
jSpinner7 . setToolTipText ( org . openide . util . NbBundle . getMessage ( AngelFontVisualPanel2 . class , "AngelFontVisualPanel2.jSpinner7.toolTipText" ) ) ; // NOI18N
jSpinner7 . addChangeListener ( new javax . swing . event . ChangeListener ( ) {
public void stateChanged ( javax . swing . event . ChangeEvent evt ) {
jSpinner7letterSpacingUpdate ( evt ) ;
}
} ) ;
javax . swing . GroupLayout jPanel3Layout = new javax . swing . GroupLayout ( jPanel3 ) ;
jPanel3 . setLayout ( jPanel3Layout ) ;
jPanel3Layout . setHorizontalGroup (
jPanel3Layout . createParallelGroup ( javax . swing . GroupLayout . Alignment . LEADING )
. addGroup ( jPanel3Layout . createSequentialGroup ( )
. addContainerGap ( )
. addGroup ( jPanel3Layout . createParallelGroup ( javax . swing . GroupLayout . Alignment . TRAILING )
. addComponent ( jLabel11 )
. addComponent ( jLabel9 )
. addComponent ( jLabel1 )
. addComponent ( jLabel6 ) )
. addGroup ( jPanel3Layout . createParallelGroup ( javax . swing . GroupLayout . Alignment . TRAILING , false )
. addGroup ( javax . swing . GroupLayout . Alignment . LEADING , jPanel3Layout . createSequentialGroup ( )
. addGap ( 27 , 27 , 27 )
. addGroup ( jPanel3Layout . createParallelGroup ( javax . swing . GroupLayout . Alignment . TRAILING )
. addComponent ( jLabel9 )
. addComponent ( jLabel1 )
. addComponent ( jLabel6 ) ) )
. addGroup ( javax . swing . GroupLayout . Alignment . LEADING , jPanel3Layout . createSequentialGroup ( )
. addContainerGap ( )
. addGroup ( jPanel3Layout . createParallelGroup ( javax . swing . GroupLayout . Alignment . LEADING )
. addGroup ( jPanel3Layout . createSequentialGroup ( )
. addGap ( 10 , 10 , 10 )
. addComponent ( jLabel12 , javax . swing . GroupLayout . DEFAULT_SIZE , javax . swing . GroupLayout . DEFAULT_SIZE , Short . MAX_VALUE ) )
. addComponent ( jLabel11 , javax . swing . GroupLayout . DEFAULT_SIZE , javax . swing . GroupLayout . DEFAULT_SIZE , Short . MAX_VALUE ) ) ) )
. addPreferredGap ( javax . swing . LayoutStyle . ComponentPlacement . RELATED )
. addGroup ( jPanel3Layout . createParallelGroup ( javax . swing . GroupLayout . Alignment . LEADING )
. addComponent ( jSpinner1 , javax . swing . GroupLayout . Alignment . TRAILING , javax . swing . GroupLayout . DEFAULT_SIZE , 78 , Short . MAX_VALUE )
. addComponent ( jLabel10 , javax . swing . GroupLayout . DEFAULT_SIZE , 78 , Short . MAX_VALUE )
. addComponent ( jComboBox1 , javax . swing . GroupLayout . Alignment . TRAILING , 0 , 78 , Short . MAX_VALUE )
. addComponent ( jSpinner5 , javax . swing . GroupLayout . DEFAULT_SIZE , 78 , Short . MAX_VALUE ) )
. addComponent ( jSpinner1 , javax . swing . GroupLayout . Alignment . TRAILING )
. addComponent ( jLabel10 , javax . swing . GroupLayout . DEFAULT_SIZE , javax . swing . GroupLayout . DEFAULT_SIZE , Short . MAX_VALUE )
. addComponent ( jComboBox1 , javax . swing . GroupLayout . Alignment . TRAILING , 0 , javax . swing . GroupLayout . DEFAULT_SIZE , Short . MAX_VALUE )
. addComponent ( jSpinner5 )
. addGroup ( jPanel3Layout . createSequentialGroup ( )
. addComponent ( jSpinner6 , javax . swing . GroupLayout . PREFERRED_SIZE , 60 , Short . MAX_VALUE )
. addPreferredGap ( javax . swing . LayoutStyle . ComponentPlacement . RELATED )
. addComponent ( jLabel13 )
. addPreferredGap ( javax . swing . LayoutStyle . ComponentPlacement . RELATED )
. addComponent ( jSpinner7 , javax . swing . GroupLayout . PREFERRED_SIZE , 58 , Short . MAX_VALUE ) ) )
. addContainerGap ( ) )
) ;
jPanel3Layout . setVerticalGroup (
@ -246,10 +283,16 @@ public final class AngelFontVisualPanel2 extends JPanel {
. addGroup ( jPanel3Layout . createParallelGroup ( javax . swing . GroupLayout . Alignment . BASELINE )
. addComponent ( jSpinner1 , javax . swing . GroupLayout . PREFERRED_SIZE , 23 , javax . swing . GroupLayout . PREFERRED_SIZE )
. addComponent ( jLabel1 ) )
. addPreferredGap ( javax . swing . LayoutStyle . ComponentPlacement . RELATED , 7 , Short . MAX_VALUE )
. addPreferredGap ( javax . swing . LayoutStyle . ComponentPlacement . RELATED )
. addGroup ( jPanel3Layout . createParallelGroup ( javax . swing . GroupLayout . Alignment . BASELINE )
. addComponent ( jSpinner5 , javax . swing . GroupLayout . PREFERRED_SIZE , 23 , javax . swing . GroupLayout . PREFERRED_SIZE )
. addComponent ( jLabel11 ) )
. addPreferredGap ( javax . swing . LayoutStyle . ComponentPlacement . RELATED , 8 , Short . MAX_VALUE )
. addGroup ( jPanel3Layout . createParallelGroup ( javax . swing . GroupLayout . Alignment . BASELINE )
. addComponent ( jLabel11 )
. addComponent ( jSpinner5 , javax . swing . GroupLayout . PREFERRED_SIZE , 23 , javax . swing . GroupLayout . PREFERRED_SIZE ) )
. addComponent ( jLabel12 , javax . swing . GroupLayout . PREFERRED_SIZE , 29 , javax . swing . GroupLayout . PREFERRED_SIZE )
. addComponent ( jSpinner6 , javax . swing . GroupLayout . PREFERRED_SIZE , 23 , javax . swing . GroupLayout . PREFERRED_SIZE )
. addComponent ( jLabel13 )
. addComponent ( jSpinner7 , javax . swing . GroupLayout . PREFERRED_SIZE , 23 , javax . swing . GroupLayout . PREFERRED_SIZE ) )
. addContainerGap ( ) )
) ;
@ -257,20 +300,21 @@ public final class AngelFontVisualPanel2 extends JPanel {
this . setLayout ( layout ) ;
layout . setHorizontalGroup (
layout . createParallelGroup ( javax . swing . GroupLayout . Alignment . LEADING )
. addGroup ( javax . swing . GroupLayout . Alignment . TRAILING , layout . createSequentialGroup ( )
. addGroup ( layout . createSequentialGroup ( )
. addComponent ( jPanel3 , javax . swing . GroupLayout . DEFAULT_SIZE , javax . swing . GroupLayout . DEFAULT_SIZE , Short . MAX_VALUE )
. addPreferredGap ( javax . swing . LayoutStyle . ComponentPlacement . RELATED )
. addComponent ( jPanel2 , javax . swing . GroupLayout . PREFERRED_SIZE , javax . swing . GroupLayout . DEFAULT_SIZE , javax . swing . GroupLayout . PREFERRED_SIZE ) )
. addComponent ( jPanel1 , javax . swing . GroupLayout . DEFAULT_SIZE , 531 , Short . MAX_VALUE )
. addComponent ( jPanel2 , javax . swing . GroupLayout . DEFAULT_SIZE , javax . swing . GroupLayout . DEFAULT_SIZE , Short . MAX_VALUE )
. addContainerGap ( ) )
. addComponent ( jPanel1 , javax . swing . GroupLayout . DEFAULT_SIZE , javax . swing . GroupLayout . DEFAULT_SIZE , Short . MAX_VALUE )
) ;
layout . setVerticalGroup (
layout . createParallelGroup ( javax . swing . GroupLayout . Alignment . LEADING )
. addGroup ( javax . swing . GroupLayout . Alignment . TRAILING , layout . createSequentialGroup ( )
. addComponent ( jPanel1 , javax . swing . GroupLayout . DEFAULT_SIZE , 404 , Short . MAX_VALUE )
. addPreferredGap ( javax . swing . LayoutStyle . ComponentPlacement . RELATED )
. addGroup ( layout . createParallelGroup ( javax . swing . GroupLayout . Alignment . LEADING , false )
. addComponent ( jPanel2 , javax . swing . GroupLayout . DEFAULT _SIZE, javax . swing . GroupLayout . DEFAULT_SIZE , Short . MAX_VALU E)
. addComponent ( jPanel3 , javax . swing . GroupLayout . DEFAULT _SIZE, javax . swing . GroupLayout . DEFAULT_SIZE , Short . MAX_VALU E) ) )
. addComponent ( jPanel1 , javax . swing . GroupLayout . DEFAULT_SIZE , 432 , Short . MAX_VALUE )
. addPreferredGap ( javax . swing . LayoutStyle . ComponentPlacement . UN RELATED)
. addGroup ( layout . createParallelGroup ( javax . swing . GroupLayout . Alignment . LEADING )
. addComponent ( jPanel2 , javax . swing . GroupLayout . PREFERRED _SIZE, javax . swing . GroupLayout . DEFAULT_SIZE , javax . swing . GroupLayout . PREFERRED_SIZ E)
. addComponent ( jPanel3 , javax . swing . GroupLayout . PREFERRED _SIZE, javax . swing . GroupLayout . DEFAULT_SIZE , javax . swing . GroupLayout . PREFERRED_SIZ E) ) )
) ;
} // </editor-fold>//GEN-END:initComponents
@ -312,12 +356,25 @@ private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-F
private void letterSpacingUpdate ( javax . swing . event . ChangeEvent evt ) { //GEN-FIRST:event_letterSpacingUpdate
letterSpacing = ( Integer ) jSpinner5 . getValue ( ) ;
} //GEN-LAST:event_letterSpacingUpdate
private void jSpinner6letterSpacingUpdate ( javax . swing . event . ChangeEvent evt ) { //GEN-FIRST:event_jSpinner6letterSpacingUpdate
charRangeStart = ( Integer ) jSpinner6 . getValue ( ) ;
updateFont ( ) ;
} //GEN-LAST:event_jSpinner6letterSpacingUpdate
private void jSpinner7letterSpacingUpdate ( javax . swing . event . ChangeEvent evt ) { //GEN-FIRST:event_jSpinner7letterSpacingUpdate
charRangeEnd = ( Integer ) jSpinner7 . getValue ( ) ;
updateFont ( ) ;
} //GEN-LAST:event_jSpinner7letterSpacingUpdate
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax . swing . JButton jButton1 ;
private javax . swing . JComboBox jComboBox1 ;
private javax . swing . JLabel jLabel1 ;
private javax . swing . JLabel jLabel10 ;
private javax . swing . JLabel jLabel11 ;
private javax . swing . JLabel jLabel12 ;
private javax . swing . JLabel jLabel13 ;
private javax . swing . JLabel jLabel2 ;
private javax . swing . JLabel jLabel3 ;
private javax . swing . JLabel jLabel4 ;
@ -334,6 +391,8 @@ private void letterSpacingUpdate(javax.swing.event.ChangeEvent evt) {//GEN-FIRST
private javax . swing . JSpinner jSpinner3 ;
private javax . swing . JSpinner jSpinner4 ;
private javax . swing . JSpinner jSpinner5 ;
private javax . swing . JSpinner jSpinner6 ;
private javax . swing . JSpinner jSpinner7 ;
private javax . swing . JTextField jTextField1 ;
// End of variables declaration//GEN-END:variables
}