TiblEdit's diacritics panel now works -- dia.dat has been added to the
repository and to TiblEdit's jar.
This commit is contained in:
parent
f09a03c9c7
commit
244a9d1370
5 changed files with 318 additions and 198 deletions
|
@ -1109,6 +1109,11 @@ Contributor(s): ______________________________________.
|
|||
<include name="org/thdl/tib/**/*.ini"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
<copy todir="${mybin}">
|
||||
<fileset dir="${source}">
|
||||
<include name="org/thdl/tib/bibl/dia.dat"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
<copy todir="${mybin}">
|
||||
<fileset dir="${source}">
|
||||
<include name="keyboards.ini"/>
|
||||
|
|
|
@ -29,7 +29,9 @@ import java.awt.event.MouseEvent;
|
|||
import java.io.File;
|
||||
import java.io.FileReader;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import javax.swing.SwingConstants;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JPanel;
|
||||
|
@ -43,18 +45,21 @@ import javax.swing.border.LineBorder;
|
|||
import javax.swing.text.*;
|
||||
|
||||
/**
|
||||
*<p>
|
||||
* This class creates a panel that displays all the relevant diacritic characters used in Asian Studies.
|
||||
* In the context of TibEdit, it's constructor takes a TibFrame which is its parent. When the mouse is clicked
|
||||
* on any diacritic character displayed in DiacriticPanel, it inserts that character at the cursor of the
|
||||
* TibFrame's {@link TextPane}. All characters are, of course, in Unicode. The file that is the list of diacrtics
|
||||
* is dia.dat in the /bin/ directory. It is a flat file list of the hexadecimal codes for the Unicode diacritics.
|
||||
* These are read and converted into characters by DiacriticPanel and they are displayed in the order they are read.
|
||||
* Thus, to reorder, modify, or add diacritics, one needs only to make the appropriate changes to the dia.dat file.
|
||||
* </p>
|
||||
* <p>This class creates a panel that displays all the relevant
|
||||
* diacritic characters used in Asian Studies. In the context of
|
||||
* TiblEdit, its constructor takes a TibFrame which is its
|
||||
* parent. When the mouse is clicked on any diacritic character
|
||||
* displayed in DiacriticPanel, it inserts that character at the
|
||||
* cursor of the TibFrame's {@link TextPane}. All characters are,
|
||||
* of course, in Unicode. The file that is the list of diacritics
|
||||
* is dia.dat in the same directory as this class's class file. It
|
||||
* is a flat file list of the hexadecimal codes for the Unicode
|
||||
* diacritics. These are read and converted into characters by
|
||||
* DiacriticPanel and they are displayed in the order they are
|
||||
* read. Thus, to reorder, modify, or add diacritics, one needs
|
||||
* only to make the appropriate changes to the dia.dat file.</p>
|
||||
*
|
||||
* @author Than Garson, Tibetan and Himalayan Digital Library
|
||||
*/
|
||||
* @author Than Garson, Tibetan and Himalayan Digital Library */
|
||||
|
||||
public class DiacriticPanel extends JPanel implements TibConstants
|
||||
{
|
||||
|
@ -65,7 +70,7 @@ public class DiacriticPanel extends JPanel implements TibConstants
|
|||
private TiblEdit controller;
|
||||
//private StringTokenizer dataSplitter;
|
||||
private char chosenChar;
|
||||
private boolean hasPicked;
|
||||
private boolean hasPicked; // DLC FIXME: unused
|
||||
private boolean isGeneral;
|
||||
|
||||
/**
|
||||
|
@ -82,7 +87,13 @@ public class DiacriticPanel extends JPanel implements TibConstants
|
|||
|
||||
// Split the data, create individual line labels
|
||||
try {
|
||||
BufferedReader br = new BufferedReader(new FileReader(new File(DEFAULT_DIRECTORY + DIA_DATA)));
|
||||
URL url = DiacriticPanel.class.getResource(DIA_DATA);
|
||||
if (url == null) {
|
||||
System.err.println("Cannot find " + DIA_DATA + "; aborting.");
|
||||
System.exit(1);
|
||||
}
|
||||
InputStreamReader isr = new InputStreamReader(url.openStream());
|
||||
BufferedReader br = new BufferedReader(isr);
|
||||
String line = br.readLine();
|
||||
while(line != null) {
|
||||
char diaChar = (char)Long.parseLong(line.trim(),16);
|
||||
|
@ -95,6 +106,7 @@ public class DiacriticPanel extends JPanel implements TibConstants
|
|||
} catch (IOException ioe) {
|
||||
System.out.println("An IOE caught: " + ioe.getMessage());
|
||||
ioe.printStackTrace();
|
||||
org.thdl.util.ThdlDebug.noteIffyCode();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ public interface TibConstants
|
|||
final String DATA_DIRECTORY = java.io.File.separatorChar + "data" + java.io.File.separatorChar;
|
||||
final String OUT_DIRECTORY = java.io.File.separatorChar + "data" + java.io.File.separatorChar;
|
||||
final String BIN_LOGIN = java.io.File.separatorChar + "bin" + java.io.File.separatorChar + "logs" + java.io.File.separatorChar;
|
||||
final String DIA_DATA = java.io.File.separatorChar + "bin" + java.io.File.separatorChar + "dia.dat";
|
||||
final String DIA_DATA = "dia.dat";
|
||||
final String TEMP_DIR = java.io.File.separatorChar + "bin" + java.io.File.separatorChar + "temp" + java.io.File.separatorChar;
|
||||
final String PREFS = "ttprefs.ini";
|
||||
|
||||
|
|
102
source/org/thdl/tib/bibl/dia.dat
Normal file
102
source/org/thdl/tib/bibl/dia.dat
Normal file
|
@ -0,0 +1,102 @@
|
|||
0101
|
||||
0100
|
||||
0113
|
||||
0112
|
||||
012B
|
||||
012A
|
||||
014D
|
||||
014C
|
||||
016B
|
||||
016A
|
||||
1E0D
|
||||
1E0C
|
||||
1E25
|
||||
1E24
|
||||
1E37
|
||||
1E36
|
||||
1E39
|
||||
1E38
|
||||
1E43
|
||||
1E42
|
||||
1E47
|
||||
1E46
|
||||
1E5B
|
||||
1E5A
|
||||
1E5D
|
||||
1E5C
|
||||
1E63
|
||||
1E62
|
||||
1E6D
|
||||
1E6C
|
||||
1E93
|
||||
1E92
|
||||
1E41
|
||||
1E40
|
||||
1E45
|
||||
1E44
|
||||
00E4
|
||||
00C4
|
||||
00EB
|
||||
00CB
|
||||
00EF
|
||||
00CF
|
||||
00F6
|
||||
00D6
|
||||
00FC
|
||||
00DC
|
||||
00E3
|
||||
00C3
|
||||
1EBD
|
||||
1EBC
|
||||
0129
|
||||
0128
|
||||
00F1
|
||||
00D1
|
||||
00F5
|
||||
00D5
|
||||
0169
|
||||
0168
|
||||
00E1
|
||||
00C1
|
||||
00E9
|
||||
00C9
|
||||
00ED
|
||||
00CD
|
||||
00F3
|
||||
00D3
|
||||
015B
|
||||
015A
|
||||
00FA
|
||||
00DA
|
||||
00FD
|
||||
00DD
|
||||
017A
|
||||
0179
|
||||
00E0
|
||||
00C0
|
||||
00E8
|
||||
00C8
|
||||
00EC
|
||||
00CC
|
||||
00F2
|
||||
00D2
|
||||
00F9
|
||||
00D9
|
||||
00E2
|
||||
00C2
|
||||
00EA
|
||||
00CA
|
||||
00EE
|
||||
00CE
|
||||
00F4
|
||||
00D4
|
||||
00FB
|
||||
00DB
|
||||
00E7
|
||||
00C7
|
||||
015F
|
||||
015E
|
||||
0161
|
||||
0160
|
||||
017E
|
||||
017D
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
@(#)package.html
|
||||
|
||||
Copyright 2001-2003 Tibetan and Himalayan Digital Library
|
||||
Copyright 2001-2004 Tibetan and Himalayan Digital Library
|
||||
|
||||
This software is the confidential and proprietary information of
|
||||
the Tibetan and Himalayan Digital Library. You shall use such
|
||||
|
@ -15,10 +15,11 @@
|
|||
-->
|
||||
</head>
|
||||
<body bgcolor="white">
|
||||
Provides classes and methods for the Tibbibl application.
|
||||
Provides classes and methods for the TiblEdit application.
|
||||
<p>
|
||||
Tibbibl is for editing scholarly bibliographies of Tibetan texts,
|
||||
where the bibliographies are stored as XML instances.
|
||||
TiblEdit is for editing scholarly bibliographies of Tibetan texts,
|
||||
where the bibliographies are stored as XML instances using the TIBBIBL
|
||||
schema.
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
|
|
Loading…
Reference in a new issue