Methods Summary |
---|
public void | adjustmentValueChanged(java.awt.event.AdjustmentEvent e)
updateBackBuffer = true;
fc.repaint();
|
public void | doPageSetup()
if ( printer == null ) {
printer = PrinterJob.getPrinterJob();
page = printer.defaultPage();
}
page = printer.pageDialog( page );
|
public void | doPrint(int i)
if ( printer == null ) {
printer = PrinterJob.getPrinterJob();
page = printer.defaultPage();
}
printMode = i;
printer.setPrintable( fc, page );
if ( printer.printDialog() ) {
try {
printer.print();
}
catch ( Exception e ) {
f2dt.fireChangeStatus( "ERROR: Printing Failed; See Stack Trace", true );
}
}
|
public void | doSaveJPEG(java.lang.String fileName)
fc.writeJPEG( fileName );
|
private java.awt.geom.AffineTransform | getAffineTransform(int transform)
/// ABP
AffineTransform at = new AffineTransform();
switch ( transform )
{
case SCALE:
at.setToScale( 1.5f, 1.5f ); break;
case ROTATE:
at.setToRotation( Math.PI / 6 ); break;
case SHEAR:
at.setToShear( 0.4f, 0 ); break;
case NONE:
break;
default:
//System.err.println( "Illegal G2 Transform Arg: " + transform);
break;
}
return at;
|
public java.lang.String | getCurrentOptions()
/// Create a new String to store the options
/// The array will contain all 8 setting (font name, size...) and
/// character range or user text data used (no file text data)
int userTextSize = 0;
String options;
options = ( fontName + "\n" + fontSize + "\n" + fontStyle + "\n" +
fontTransform + "\n" + g2Transform + "\n"+ textToUse + "\n" + drawMethod + "\n" +
useAntialias + "\n" + useFractional + "\n");
if ( textToUse == USER_TEXT )
for ( int i = 0; i < userText.length; i++ )
options += ( userText[i] + "\n" );
return options;
|
public java.lang.String[] | getFontInfo()
return fontInfos;
|
public java.awt.Dimension | getPreferredSize()
return new Dimension(600, 200);
|
public void | loadOptions(boolean grid, boolean force16, int start, int end, java.lang.String name, int size, int style, int transform, int g2transform, int text, int method, boolean aa, boolean fm, java.lang.String[] user)
int range[] = { start, end };
/// Since repaint call has a low priority, these functions will finish
/// before the actual repainting is done
setGridDisplay( grid );
setForce16Columns( force16 );
// previous call to readTextFile has already set the text to draw
if (textToUse != FILE_TEXT) {
setTextToDraw( text, range, user, null );
}
setFontParams( name, size, style, transform );
setTransformG2( g2transform ); // ABP
setDrawMethod( method );
setRenderingHints( aa, fm );
|
public void | paintComponent(java.awt.Graphics g)
// Windows does not repaint correctly, after
// a zoom. Thus, we need to force the canvas
// to repaint, but only once. After the first repaint,
// everything stabilizes. [ABP]
fc.repaint();
|
public void | setDrawMethod(int i)
drawMethod = i;
updateBackBuffer = true;
fc.repaint();
|
public void | setFontParams(java.lang.Object obj, int size, int style, int transform)
setFontParams( (String)obj, size, style, transform );
|
public void | setFontParams(java.lang.String name, int size, int style, int transform)
boolean fontModified = false;
if ( !name.equals( fontName ) || style != fontStyle )
fontModified = true;
fontName = name;
fontSize = size;
fontStyle = style;
fontTransform = transform;
/// Recreate the font as specified
testFont = new Font( fontName, fontStyle, fontSize );
if ( fontTransform != NONE ) {
AffineTransform at = getAffineTransform( fontTransform );
testFont = testFont.deriveFont( at );
}
updateBackBuffer = true;
updateFontMetrics = true;
fc.repaint();
if ( fontModified ) {
/// Tell main panel to update the font info
updateFontInfo();
f2dt.fireUpdateFontInfo();
}
|
public void | setForce16Columns(boolean b)
force16Cols = b;
updateBackBuffer = true;
updateFontMetrics = true;
fc.repaint();
|
public void | setGridDisplay(boolean b)
showGrid = b;
updateBackBuffer = true;
fc.repaint();
|
public void | setRenderingHints(boolean aa, boolean fm)
useAntialias = aa;
useFractional = fm;
updateBackBuffer = true;
updateFontMetrics = true;
fc.repaint();
|
public void | setTextToDraw(int i, int[] range, java.lang.String[] textSet, java.lang.String[] fileData)
textToUse = i;
if ( textToUse == RANGE_TEXT )
drawRange = range;
else if ( textToUse == ALL_GLYPHS )
drawMethod = DRAW_GLYPHV;
else if ( textToUse == USER_TEXT )
userText = textSet;
else if ( textToUse == FILE_TEXT ) {
fileText = fileData;
drawMethod = TL_DRAW;
}
updateBackBuffer = true;
updateFontMetrics = true;
fc.repaint();
updateFontInfo();
|
public void | setTransformG2(int transform)
g2Transform = transform;
updateBackBuffer = true;
updateFontMetrics = true;
fc.repaint();
|
private void | updateFontInfo()
int numGlyphs = 0, numCharsInRange = drawRange[1] - drawRange[0] + 1;
fontInfos[0] = "Font Face Name: " + testFont.getFontName();
fontInfos[1] = "Glyphs in This Range: ";
if ( textToUse == RANGE_TEXT ) {
for ( int i = drawRange[0]; i < drawRange[1]; i++ )
if ( testFont.canDisplay( (char) i ))
numGlyphs++;
fontInfos[1] = fontInfos[1] + numGlyphs + " / " + numCharsInRange;
}
else
fontInfos[1] = null;
|