bugged
stringlengths 6
599k
| fixed
stringlengths 6
40.8M
| __index_level_0__
int64 0
3.24M
|
|---|---|---|
private static void read_individual_sections(Map entries, BufferedReader br) throws IOException { String s = br.readLine(); while (s != null && (!s.equals(""))) { Attributes attr = read_section_name(s, br, entries); read_attributes(attr, br); s = br.readLine(); } }
|
private static void read_individual_sections(Map entries, BufferedReader br) throws IOException { String s = br.readLine(); while (s != null && (!s.equals(""))) { Attributes attr = read_section_name(s, br, entries); read_attributes(attr, br); s = br.readLine(); } }
| 11,334
|
private static void read_main_section(Attributes attr, BufferedReader br) throws IOException { // According to the spec we should actually call read_version_info() here. read_attributes(attr, br); // Explicitly set Manifest-Version attribute if not set in Main // attributes of Manifest. if (attr.getValue(Attributes.Name.MANIFEST_VERSION) == null) attr.putValue(Attributes.Name.MANIFEST_VERSION, "0.0"); }
|
private static void read_main_section(Attributes attr, BufferedReader br) throws IOException { // According to the spec we should actually call read_version_info() here. read_attributes(attr, br); // Explicitly set Manifest-Version attribute if not set in Main // attributes of Manifest. if (attr.getValue(Attributes.Name.MANIFEST_VERSION) == null) attr.putValue(Attributes.Name.MANIFEST_VERSION, "0.0"); }
| 11,335
|
private static Attributes read_section_name(String s, BufferedReader br, Map entries) throws JarException { try { String name = expect_header("Name", br, s); Attributes attr = new Attributes(); entries.put(name, attr); return attr; } catch (IOException ioe) { throw new JarException("Section should start with a Name header: " + ioe.getMessage()); } }
|
private static Attributes read_section_name(String s, BufferedReader br, Map entries) throws JarException { try { String name = expect_header("Name", br, s); Attributes attr = new Attributes(); entries.put(name, attr); return attr; } catch (IOException ioe) { throw new JarException("Section should start with a Name header: " + ioe.getMessage()); } }
| 11,336
|
private static Attributes read_section_name(String s, BufferedReader br, Map entries) throws JarException { try { String name = expect_header("Name", br, s); Attributes attr = new Attributes(); entries.put(name, attr); return attr; } catch (IOException ioe) { throw new JarException("Section should start with a Name header: " + ioe.getMessage()); } }
|
private static Attributes read_section_name(String s, BufferedReader br, Map entries) throws JarException { try { String name = expect_header("Name", br, s); Attributes attr = new Attributes(); entries.put(name, attr); return attr; } catch (IOException ioe) { throw new JarException("Section should start with a Name header: " + ioe.getMessage()); } }
| 11,337
|
private static void read_version_info(Attributes attr, BufferedReader br) throws IOException { String version_header = Attributes.Name.MANIFEST_VERSION.toString(); try { String value = expect_header(version_header, br); attr.putValue(Attributes.Name.MANIFEST_VERSION, value); } catch (IOException ioe) { throw new JarException("Manifest should start with a " + version_header + ": " + ioe.getMessage()); } }
|
private static void read_version_info(Attributes attr, BufferedReader br) throws IOException { String version_header = Attributes.Name.MANIFEST_VERSION.toString(); try { String value = expect_header(version_header, br); attr.putValue(Attributes.Name.MANIFEST_VERSION, value); } catch (IOException ioe) { throw new JarException("Manifest should start with a " + version_header + ": " + ioe.getMessage()); } }
| 11,338
|
private static void read_version_info(Attributes attr, BufferedReader br) throws IOException { String version_header = Attributes.Name.MANIFEST_VERSION.toString(); try { String value = expect_header(version_header, br); attr.putValue(Attributes.Name.MANIFEST_VERSION, value); } catch (IOException ioe) { throw new JarException("Manifest should start with a " + version_header + ": " + ioe.getMessage()); } }
|
private static void read_version_info(Attributes attr, BufferedReader br) throws IOException { String version_header = Attributes.Name.MANIFEST_VERSION.toString(); try { String value = expect_header(version_header, br); attr.putValue(Attributes.Name.MANIFEST_VERSION, value); } catch (IOException ioe) { throw new JarException("Manifest should start with a " + version_header + ": " + ioe.getMessage()); } }
| 11,339
|
private static void read_version_info(Attributes attr, BufferedReader br) throws IOException { String version_header = Attributes.Name.MANIFEST_VERSION.toString(); try { String value = expect_header(version_header, br); attr.putValue(Attributes.Name.MANIFEST_VERSION, value); } catch (IOException ioe) { throw new JarException("Manifest should start with a " + version_header + ": " + ioe.getMessage()); } }
|
private static void read_version_info(Attributes attr, BufferedReader br) throws IOException { String version_header = Attributes.Name.MANIFEST_VERSION.toString(); try { String value = expect_header(version_header, br); attr.putValue(Attributes.Name.MANIFEST_VERSION, value); } catch (IOException ioe) { throw new JarException("Manifest should start with a " + version_header + ": " + ioe.getMessage()); } }
| 11,340
|
private static void write_attribute_entry(Map.Entry entry, PrintWriter pw) throws JarException { String name = entry.getKey().toString(); String value = entry.getValue().toString(); if (name.equalsIgnoreCase("Name")) { throw new JarException("Attributes cannot be called 'Name'"); } if (name.startsWith("From")) { throw new JarException("Header cannot start with the four letters 'From'" + name); } write_header(name, value, pw); }
|
private static void write_attribute_entry(Map.Entry entry, PrintWriter pw) throws JarException { String name = entry.getKey().toString(); String value = entry.getValue().toString(); if (name.equalsIgnoreCase("Name")) { throw new JarException("Attributes cannot be called 'Name'"); } if (name.startsWith("From")) { throw new JarException("Header cannot start with the four letters 'From'" + name); } write_header(name, value, pw); }
| 11,341
|
private static void write_attribute_entry(Map.Entry entry, PrintWriter pw) throws JarException { String name = entry.getKey().toString(); String value = entry.getValue().toString(); if (name.equalsIgnoreCase("Name")) { throw new JarException("Attributes cannot be called 'Name'"); } if (name.startsWith("From")) { throw new JarException("Header cannot start with the four letters 'From'" + name); } write_header(name, value, pw); }
|
private static void write_attribute_entry(Map.Entry entry, PrintWriter pw) throws JarException { String name = entry.getKey().toString(); String value = entry.getValue().toString(); if (name.equalsIgnoreCase("Name")) { throw new JarException("Attributes cannot be called 'Name'"); } if (name.startsWith("From")) { throw new JarException("Header cannot start with the four letters 'From'" + name); } write_header(name, value, pw); }
| 11,342
|
private static void write_attribute_entry(Map.Entry entry, PrintWriter pw) throws JarException { String name = entry.getKey().toString(); String value = entry.getValue().toString(); if (name.equalsIgnoreCase("Name")) { throw new JarException("Attributes cannot be called 'Name'"); } if (name.startsWith("From")) { throw new JarException("Header cannot start with the four letters 'From'" + name); } write_header(name, value, pw); }
|
private static void write_attribute_entry(Map.Entry entry, PrintWriter pw) throws JarException { String name = entry.getKey().toString(); String value = entry.getValue().toString(); if (name.equalsIgnoreCase("Name")) { throw new JarException("Attributes cannot be called 'Name'"); } if (name.startsWith("From")) { throw new JarException("Header cannot start with the four letters 'From'" + name); } write_header(name, value, pw); }
| 11,343
|
private static void write_entry_attributes(Attributes attr, PrintWriter pw) throws JarException { Iterator it = attr.entrySet().iterator(); while (it.hasNext()) { Map.Entry entry = (Map.Entry) it.next(); write_attribute_entry(entry, pw); } }
|
private static void write_entry_attributes(Attributes attr, PrintWriter pw) throws JarException { Iterator it = attr.entrySet().iterator(); while (it.hasNext()) { Map.Entry entry = (Map.Entry) it.next(); write_attribute_entry(entry, pw); } }
| 11,344
|
private static void write_entry_attributes(Attributes attr, PrintWriter pw) throws JarException { Iterator it = attr.entrySet().iterator(); while (it.hasNext()) { Map.Entry entry = (Map.Entry) it.next(); write_attribute_entry(entry, pw); } }
|
private static void write_entry_attributes(Attributes attr, PrintWriter pw) throws JarException { Iterator it = attr.entrySet().iterator(); while (it.hasNext()) { Map.Entry entry = (Map.Entry) it.next(); write_attribute_entry(entry, pw); } }
| 11,345
|
private static void write_header(String name, String value, PrintWriter pw) { pw.print(name + ": "); int last = 68 - name.length(); if (last > value.length()) { pw.println(value); } else { pw.println(value.substring(0, last)); } while (last < value.length()) { pw.print(" "); int end = (last + 69); if (end > value.length()) { pw.println(value.substring(last)); } else { pw.println(value.substring(last, end)); } last = end; } }
|
private static void write_header(String name, String value, PrintWriter pw) { pw.print(name + ": "); int last = 68 - name.length(); if (last > value.length()) { pw.println(value); } else { pw.println(value.substring(0, last)); } while (last < value.length()) { pw.print(" "); int end = (last + 69); if (end > value.length()) { pw.println(value.substring(last)); } else { pw.println(value.substring(last, end)); } last = end; } }
| 11,346
|
private static void write_header(String name, String value, PrintWriter pw) { pw.print(name + ": "); int last = 68 - name.length(); if (last > value.length()) { pw.println(value); } else { pw.println(value.substring(0, last)); } while (last < value.length()) { pw.print(" "); int end = (last + 69); if (end > value.length()) { pw.println(value.substring(last)); } else { pw.println(value.substring(last, end)); } last = end; } }
|
private static void write_header(String name, String value, PrintWriter pw) { pw.print(name + ": "); int last = 68 - name.length(); if (last > value.length()) { pw.println(value); } else { pw.println(value.substring(0, last)); } while (last < value.length()) { pw.print(" "); int end = (last + 69); if (end > value.length()) { pw.println(value.substring(last)); } else { pw.println(value.substring(last, end)); } last = end; } }
| 11,347
|
private static void write_header(String name, String value, PrintWriter pw) { pw.print(name + ": "); int last = 68 - name.length(); if (last > value.length()) { pw.println(value); } else { pw.println(value.substring(0, last)); } while (last < value.length()) { pw.print(" "); int end = (last + 69); if (end > value.length()) { pw.println(value.substring(last)); } else { pw.println(value.substring(last, end)); } last = end; } }
|
private static void write_header(String name, String value, PrintWriter pw) { pw.print(name + ": "); int last = 68 - name.length(); if (last > value.length()) { pw.println(value); } else { pw.println(value.substring(0, last)); } while (last < value.length()) { pw.print(" "); int end = (last + 69); if (end > value.length()) { pw.println(value.substring(last)); } else { pw.println(value.substring(last, end)); } last = end; } }
| 11,348
|
private static void write_header(String name, String value, PrintWriter pw) { pw.print(name + ": "); int last = 68 - name.length(); if (last > value.length()) { pw.println(value); } else { pw.println(value.substring(0, last)); } while (last < value.length()) { pw.print(" "); int end = (last + 69); if (end > value.length()) { pw.println(value.substring(last)); } else { pw.println(value.substring(last, end)); } last = end; } }
|
private static void write_header(String name, String value, PrintWriter pw) { pw.print(name + ": "); int last = 68 - name.length(); if (last > value.length()) { pw.println(value); } else { pw.println(value.substring(0, last)); } while (last < value.length()) { pw.print(" "); int end = (last + 69); if (end > value.length()) { pw.println(value.substring(last)); } else { pw.println(value.substring(last, end)); } last = end; } }
| 11,349
|
private static void write_header(String name, String value, PrintWriter pw) { pw.print(name + ": "); int last = 68 - name.length(); if (last > value.length()) { pw.println(value); } else { pw.println(value.substring(0, last)); } while (last < value.length()) { pw.print(" "); int end = (last + 69); if (end > value.length()) { pw.println(value.substring(last)); } else { pw.println(value.substring(last, end)); } last = end; } }
|
private static void write_header(String name, String value, PrintWriter pw) { pw.print(name + ": "); int last = 68 - name.length(); if (last > value.length()) { pw.println(value); } else { pw.println(value.substring(0, last)); } while (last < value.length()) { pw.print(" "); int end = (last + 69); if (end > value.length()) { pw.println(value.substring(last)); } else { pw.println(value.substring(last, end)); } last = end; } }
| 11,350
|
private static void write_header(String name, String value, PrintWriter pw) { pw.print(name + ": "); int last = 68 - name.length(); if (last > value.length()) { pw.println(value); } else { pw.println(value.substring(0, last)); } while (last < value.length()) { pw.print(" "); int end = (last + 69); if (end > value.length()) { pw.println(value.substring(last)); } else { pw.println(value.substring(last, end)); } last = end; } }
|
private static void write_header(String name, String value, PrintWriter pw) { pw.print(name + ": "); int last = 68 - name.length(); if (last > value.length()) { pw.println(value); } else { pw.println(value.substring(0, last)); } while (last < value.length()) { pw.print(" "); int end = (last + 69); if (end > value.length()) { pw.println(value.substring(last)); } else { pw.println(value.substring(last, end)); } last = end; } }
| 11,351
|
private static void write_individual_sections(Map entries, PrintWriter pw) throws JarException { Iterator it = entries.entrySet().iterator(); while (it.hasNext()) { Map.Entry entry = (Map.Entry) it.next(); write_header("Name", entry.getKey().toString(), pw); write_entry_attributes((Attributes) entry.getValue(), pw); pw.println(); } }
|
private static void write_individual_sections(Map entries, PrintWriter pw) throws JarException { Iterator it = entries.entrySet().iterator(); while (it.hasNext()) { Map.Entry entry = (Map.Entry) it.next(); write_header("Name", entry.getKey().toString(), pw); write_entry_attributes((Attributes) entry.getValue(), pw); pw.println(); } }
| 11,352
|
private static void write_individual_sections(Map entries, PrintWriter pw) throws JarException { Iterator it = entries.entrySet().iterator(); while (it.hasNext()) { Map.Entry entry = (Map.Entry) it.next(); write_header("Name", entry.getKey().toString(), pw); write_entry_attributes((Attributes) entry.getValue(), pw); pw.println(); } }
|
private static void write_individual_sections(Map entries, PrintWriter pw) throws JarException { Iterator it = entries.entrySet().iterator(); while (it.hasNext()) { Map.Entry entry = (Map.Entry) it.next(); write_header("Name", entry.getKey().toString(), pw); write_entry_attributes((Attributes) entry.getValue(), pw); pw.println(); } }
| 11,353
|
private static void write_main_attributes(Attributes attr, PrintWriter pw) throws JarException { Iterator it = attr.entrySet().iterator(); while (it.hasNext()) { Map.Entry entry = (Map.Entry) it.next(); // Don't print the manifest version again if (!Attributes.Name.MANIFEST_VERSION.equals(entry.getKey())) { write_attribute_entry(entry, pw); } } }
|
private static void write_main_attributes(Attributes attr, PrintWriter pw) throws JarException { Iterator it = attr.entrySet().iterator(); while (it.hasNext()) { Map.Entry entry = (Map.Entry) it.next(); // Don't print the manifest version again if (!Attributes.Name.MANIFEST_VERSION.equals(entry.getKey())) { write_attribute_entry(entry, pw); } } }
| 11,354
|
private static void write_main_attributes(Attributes attr, PrintWriter pw) throws JarException { Iterator it = attr.entrySet().iterator(); while (it.hasNext()) { Map.Entry entry = (Map.Entry) it.next(); // Don't print the manifest version again if (!Attributes.Name.MANIFEST_VERSION.equals(entry.getKey())) { write_attribute_entry(entry, pw); } } }
|
private static void write_main_attributes(Attributes attr, PrintWriter pw) throws JarException { Iterator it = attr.entrySet().iterator(); while (it.hasNext()) { Map.Entry entry = (Map.Entry) it.next(); // Don't print the manifest version again if (!Attributes.Name.MANIFEST_VERSION.equals(entry.getKey())) { write_attribute_entry(entry, pw); } } }
| 11,355
|
private static void write_main_attributes(Attributes attr, PrintWriter pw) throws JarException { Iterator it = attr.entrySet().iterator(); while (it.hasNext()) { Map.Entry entry = (Map.Entry) it.next(); // Don't print the manifest version again if (!Attributes.Name.MANIFEST_VERSION.equals(entry.getKey())) { write_attribute_entry(entry, pw); } } }
|
private static void write_main_attributes(Attributes attr, PrintWriter pw) throws JarException { Iterator it = attr.entrySet().iterator(); while (it.hasNext()) { Map.Entry entry = (Map.Entry) it.next(); // Don't print the manifest version again if (!Attributes.Name.MANIFEST_VERSION.equals(entry.getKey())) { write_attribute_entry(entry, pw); } } }
| 11,356
|
private static void write_main_section(Attributes attr, PrintWriter pw) throws JarException { write_version_info(attr, pw); write_main_attributes(attr, pw); }
|
private static void write_main_section(Attributes attr, PrintWriter pw) throws JarException { write_version_info(attr, pw); write_main_attributes(attr, pw); }
| 11,357
|
private static void write_version_info(Attributes attr, PrintWriter pw) { // First check if there is already a version attribute set String version = attr.getValue(Attributes.Name.MANIFEST_VERSION); if (version == null) { version = "1.0"; } write_header(Attributes.Name.MANIFEST_VERSION.toString(), version, pw); }
|
private static void write_version_info(Attributes attr, PrintWriter pw) { // First check if there is already a version attribute set String version = attr.getValue(Attributes.Name.MANIFEST_VERSION); if (version == null) { version = "1.0"; } write_header(Attributes.Name.MANIFEST_VERSION.toString(), version, pw); }
| 11,358
|
private static void write_version_info(Attributes attr, PrintWriter pw) { // First check if there is already a version attribute set String version = attr.getValue(Attributes.Name.MANIFEST_VERSION); if (version == null) { version = "1.0"; } write_header(Attributes.Name.MANIFEST_VERSION.toString(), version, pw); }
|
private static void write_version_info(Attributes attr, PrintWriter pw) { // First check if there is already a version attribute set String version = attr.getValue(Attributes.Name.MANIFEST_VERSION); if (version == null) { version = "1.0"; } write_header(Attributes.Name.MANIFEST_VERSION.toString(), version, pw); }
| 11,359
|
public InternalFrameAdapter() { } // InternalFrameAdapter()
|
public InternalFrameAdapter() { } // InternalFrameAdapter()
| 11,360
|
public void paint(Graphics g, int p0, int p1, Shape bounds, JTextComponent t) { if (p0 == p1) return; Rectangle rect = bounds.getBounds(); if (color == null) g.setColor(t.getSelectionColor()); else g.setColor(color); TextUI ui = t.getUI(); try { Rectangle l0 = ui.modelToView(t, p0, null); Rectangle l1 = ui.modelToView(t, p1, null); // Note: The computed locations may lie outside of the allocation // area if the text is scrolled. if (l0.y == l1.y) { SwingUtilities.computeUnion(l0.x, l0.y, l0.width, l0.height, l1); // Paint only inside the allocation area. SwingUtilities.computeIntersection(rect.x, rect.y, rect.width, rect.height, l1); paintHighlight(g, l1); } else { // 1. The line of p0 is painted from the position of p0 // to the right border. // 2. All lines between the ones where p0 and p1 lie on // are completely highlighted. The allocation area is used to find // out the bounds. // 3. The final line is painted from the left border to the // position of p1. // Highlight first line until the end. // If rect.x is non-zero the calculation will properly adjust the // area to be painted. l0.x -= rect.x; l0.width = rect.width - l0.x - rect.x; paintHighlight(g, l0); int posBelow = Utilities.getPositionBelow(t, p0, l0.x); int p1RowStart = Utilities.getRowStart(t, p1); if (posBelow != -1 && posBelow != p0 && Utilities.getRowStart(t, posBelow) != p1RowStart) { Rectangle grow = ui.modelToView(t, posBelow); grow.x = rect.x; grow.width = rect.width; // Find further lines which have to be highlighted completely. int nextPosBelow = posBelow; while (nextPosBelow != -1 && Utilities.getRowStart(t, nextPosBelow) != p1RowStart) { posBelow = nextPosBelow; nextPosBelow = Utilities.getPositionBelow(t, posBelow, l0.x); if (nextPosBelow == posBelow) break; } // Now posBelow is an offset on the last line which has to be painted // completely. (newPosBelow is on the same line as p1) // Retrieve the rectangle of posBelow and use its y and height // value to calculate the final height of the multiple line // spanning rectangle. Rectangle end = ui.modelToView(t, posBelow); grow.height = end.y + end.height - grow.y; paintHighlight(g, grow); } // Paint last line from its beginning to the position of p1. l1.width = l1.x + l1.width - rect.x; l1.x = rect.x; paintHighlight(g, l1); } } catch (BadLocationException ex) { AssertionError err = new AssertionError("Unexpected bad location exception"); err.initCause(ex); throw err; } }
|
public void paint(Graphics g, int p0, int p1, Shape bounds, JTextComponent t) { if (p0 == p1) return; Rectangle rect = bounds.getBounds(); if (color == null) g.setColor(t.getSelectionColor()); else g.setColor(color); TextUI ui = t.getUI(); try { Rectangle l0 = ui.modelToView(t, p0, null); Rectangle l1 = ui.modelToView(t, p1, null); // Note: The computed locations may lie outside of the allocation // area if the text is scrolled. if (l0.y == l1.y) { SwingUtilities.computeUnion(l0.x, l0.y, l0.width, l0.height, l1); // Paint only inside the allocation area. SwingUtilities.computeIntersection(rect.x, rect.y, rect.width, rect.height, l1); paintHighlight(g, l1); } else { // 1. The line of p0 is painted from the position of p0 // to the right border. // 2. All lines between the ones where p0 and p1 lie on // are completely highlighted. The allocation area is used to find // out the bounds. // 3. The final line is painted from the left border to the // position of p1. // Highlight first line until the end. // If rect.x is non-zero the calculation will properly adjust the // area to be painted. l0.x -= rect.x; l0.width = rect.width - l0.x - rect.x; paintHighlight(g, l0); int posBelow = Utilities.getPositionBelow(t, p0, l0.x); int p1RowStart = Utilities.getRowStart(t, p1); if (posBelow != -1 && posBelow != p0 && Utilities.getRowStart(t, posBelow) != p1RowStart) { Rectangle grow = ui.modelToView(t, posBelow); grow.x = rect.x; grow.width = rect.width; // Find further lines which have to be highlighted completely. int nextPosBelow = posBelow; while (nextPosBelow != -1 && Utilities.getRowStart(t, nextPosBelow) != p1RowStart) { posBelow = nextPosBelow; nextPosBelow = Utilities.getPositionBelow(t, posBelow, l0.x); if (nextPosBelow == posBelow) break; } // Now posBelow is an offset on the last line which has to be painted // completely. (newPosBelow is on the same line as p1) // Retrieve the rectangle of posBelow and use its y and height // value to calculate the final height of the multiple line // spanning rectangle. Rectangle end = ui.modelToView(t, posBelow); grow.height = end.y + end.height - grow.y; paintHighlight(g, grow); } // Paint last line from its beginning to the position of p1. l1.width = l1.x + l1.width - rect.x; l1.x = rect.x; paintHighlight(g, l1); } } catch (BadLocationException ex) { AssertionError err = new AssertionError("Unexpected bad location exception"); err.initCause(ex); throw err; } }
| 11,361
|
public void paint(Graphics g, int p0, int p1, Shape bounds, JTextComponent t) { if (p0 == p1) return; Rectangle rect = bounds.getBounds(); if (color == null) g.setColor(t.getSelectionColor()); else g.setColor(color); TextUI ui = t.getUI(); try { Rectangle l0 = ui.modelToView(t, p0, null); Rectangle l1 = ui.modelToView(t, p1, null); // Note: The computed locations may lie outside of the allocation // area if the text is scrolled. if (l0.y == l1.y) { SwingUtilities.computeUnion(l0.x, l0.y, l0.width, l0.height, l1); // Paint only inside the allocation area. SwingUtilities.computeIntersection(rect.x, rect.y, rect.width, rect.height, l1); paintHighlight(g, l1); } else { // 1. The line of p0 is painted from the position of p0 // to the right border. // 2. All lines between the ones where p0 and p1 lie on // are completely highlighted. The allocation area is used to find // out the bounds. // 3. The final line is painted from the left border to the // position of p1. // Highlight first line until the end. // If rect.x is non-zero the calculation will properly adjust the // area to be painted. l0.x -= rect.x; l0.width = rect.width - l0.x - rect.x; paintHighlight(g, l0); int posBelow = Utilities.getPositionBelow(t, p0, l0.x); int p1RowStart = Utilities.getRowStart(t, p1); if (posBelow != -1 && posBelow != p0 && Utilities.getRowStart(t, posBelow) != p1RowStart) { Rectangle grow = ui.modelToView(t, posBelow); grow.x = rect.x; grow.width = rect.width; // Find further lines which have to be highlighted completely. int nextPosBelow = posBelow; while (nextPosBelow != -1 && Utilities.getRowStart(t, nextPosBelow) != p1RowStart) { posBelow = nextPosBelow; nextPosBelow = Utilities.getPositionBelow(t, posBelow, l0.x); if (nextPosBelow == posBelow) break; } // Now posBelow is an offset on the last line which has to be painted // completely. (newPosBelow is on the same line as p1) // Retrieve the rectangle of posBelow and use its y and height // value to calculate the final height of the multiple line // spanning rectangle. Rectangle end = ui.modelToView(t, posBelow); grow.height = end.y + end.height - grow.y; paintHighlight(g, grow); } // Paint last line from its beginning to the position of p1. l1.width = l1.x + l1.width - rect.x; l1.x = rect.x; paintHighlight(g, l1); } } catch (BadLocationException ex) { AssertionError err = new AssertionError("Unexpected bad location exception"); err.initCause(ex); throw err; } }
|
public void paint(Graphics g, int p0, int p1, Shape bounds, JTextComponent t) { if (p0 == p1) return; Rectangle rect = bounds.getBounds(); if (color == null) g.setColor(t.getSelectionColor()); else g.setColor(color); TextUI ui = t.getUI(); try { Rectangle l0 = ui.modelToView(t, p0, null); Rectangle l1 = ui.modelToView(t, p1, null); // Note: The computed locations may lie outside of the allocation // area if the text is scrolled. if (l0.y == l1.y) { SwingUtilities.computeUnion(l0.x, l0.y, l0.width, l0.height, l1); // Paint only inside the allocation area. SwingUtilities.computeIntersection(rect.x, rect.y, rect.width, rect.height, l1); paintHighlight(g, l1); } else { // 1. The line of p0 is painted from the position of p0 // to the right border. // 2. All lines between the ones where p0 and p1 lie on // are completely highlighted. The allocation area is used to find // out the bounds. // 3. The final line is painted from the left border to the // position of p1. // Highlight first line until the end. // If rect.x is non-zero the calculation will properly adjust the // area to be painted. l0.x -= rect.x; l0.width = rect.width - l0.x - rect.x; paintHighlight(g, l0); int posBelow = Utilities.getPositionBelow(t, p0, l0.x); int p1RowStart = Utilities.getRowStart(t, p1); if (posBelow != -1 && posBelow != p0 && Utilities.getRowStart(t, posBelow) != p1RowStart) { Rectangle grow = ui.modelToView(t, posBelow); grow.x = rect.x; grow.width = rect.width; // Find further lines which have to be highlighted completely. int nextPosBelow = posBelow; while (nextPosBelow != -1 && Utilities.getRowStart(t, nextPosBelow) != p1RowStart) { posBelow = nextPosBelow; nextPosBelow = Utilities.getPositionBelow(t, posBelow, l0.x); if (nextPosBelow == posBelow) break; } // Now posBelow is an offset on the last line which has to be painted // completely. (newPosBelow is on the same line as p1) // Retrieve the rectangle of posBelow and use its y and height // value to calculate the final height of the multiple line // spanning rectangle. Rectangle end = ui.modelToView(t, posBelow); grow.height = end.y + end.height - grow.y; paintHighlight(g, grow); } // Paint last line from its beginning to the position of p1. l1.width = l1.x + l1.width - rect.x; l1.x = rect.x; paintHighlight(g, l1); } } catch (BadLocationException ex) { AssertionError err = new AssertionError("Unexpected bad location exception"); err.initCause(ex); throw err; } }
| 11,362
|
public void paint(Graphics g, int p0, int p1, Shape bounds, JTextComponent t) { if (p0 == p1) return; Rectangle rect = bounds.getBounds(); if (color == null) g.setColor(t.getSelectionColor()); else g.setColor(color); TextUI ui = t.getUI(); try { Rectangle l0 = ui.modelToView(t, p0, null); Rectangle l1 = ui.modelToView(t, p1, null); // Note: The computed locations may lie outside of the allocation // area if the text is scrolled. if (l0.y == l1.y) { SwingUtilities.computeUnion(l0.x, l0.y, l0.width, l0.height, l1); // Paint only inside the allocation area. SwingUtilities.computeIntersection(rect.x, rect.y, rect.width, rect.height, l1); paintHighlight(g, l1); } else { // 1. The line of p0 is painted from the position of p0 // to the right border. // 2. All lines between the ones where p0 and p1 lie on // are completely highlighted. The allocation area is used to find // out the bounds. // 3. The final line is painted from the left border to the // position of p1. // Highlight first line until the end. // If rect.x is non-zero the calculation will properly adjust the // area to be painted. l0.x -= rect.x; l0.width = rect.width - l0.x - rect.x; paintHighlight(g, l0); int posBelow = Utilities.getPositionBelow(t, p0, l0.x); int p1RowStart = Utilities.getRowStart(t, p1); if (posBelow != -1 && posBelow != p0 && Utilities.getRowStart(t, posBelow) != p1RowStart) { Rectangle grow = ui.modelToView(t, posBelow); grow.x = rect.x; grow.width = rect.width; // Find further lines which have to be highlighted completely. int nextPosBelow = posBelow; while (nextPosBelow != -1 && Utilities.getRowStart(t, nextPosBelow) != p1RowStart) { posBelow = nextPosBelow; nextPosBelow = Utilities.getPositionBelow(t, posBelow, l0.x); if (nextPosBelow == posBelow) break; } // Now posBelow is an offset on the last line which has to be painted // completely. (newPosBelow is on the same line as p1) // Retrieve the rectangle of posBelow and use its y and height // value to calculate the final height of the multiple line // spanning rectangle. Rectangle end = ui.modelToView(t, posBelow); grow.height = end.y + end.height - grow.y; paintHighlight(g, grow); } // Paint last line from its beginning to the position of p1. l1.width = l1.x + l1.width - rect.x; l1.x = rect.x; paintHighlight(g, l1); } } catch (BadLocationException ex) { AssertionError err = new AssertionError("Unexpected bad location exception"); err.initCause(ex); throw err; } }
|
public void paint(Graphics g, int p0, int p1, Shape bounds, JTextComponent t) { if (p0 == p1) return; Rectangle rect = bounds.getBounds(); if (color == null) g.setColor(t.getSelectionColor()); else g.setColor(color); TextUI ui = t.getUI(); try { Rectangle l0 = ui.modelToView(t, p0, null); Rectangle l1 = ui.modelToView(t, p1, null); // Note: The computed locations may lie outside of the allocation // area if the text is scrolled. if (l0.y == l1.y) { SwingUtilities.computeUnion(l0.x, l0.y, l0.width, l0.height, l1); // Paint only inside the allocation area. SwingUtilities.computeIntersection(rect.x, rect.y, rect.width, rect.height, l1); g.fillRect(l1.x, l1.y, l1.width, l1.height); } else { // 1. The line of p0 is painted from the position of p0 // to the right border. // 2. All lines between the ones where p0 and p1 lie on // are completely highlighted. The allocation area is used to find // out the bounds. // 3. The final line is painted from the left border to the // position of p1. // Highlight first line until the end. // If rect.x is non-zero the calculation will properly adjust the // area to be painted. l0.x -= rect.x; l0.width = rect.width - l0.x - rect.x; paintHighlight(g, l0); int posBelow = Utilities.getPositionBelow(t, p0, l0.x); int p1RowStart = Utilities.getRowStart(t, p1); if (posBelow != -1 && posBelow != p0 && Utilities.getRowStart(t, posBelow) != p1RowStart) { Rectangle grow = ui.modelToView(t, posBelow); grow.x = rect.x; grow.width = rect.width; // Find further lines which have to be highlighted completely. int nextPosBelow = posBelow; while (nextPosBelow != -1 && Utilities.getRowStart(t, nextPosBelow) != p1RowStart) { posBelow = nextPosBelow; nextPosBelow = Utilities.getPositionBelow(t, posBelow, l0.x); if (nextPosBelow == posBelow) break; } // Now posBelow is an offset on the last line which has to be painted // completely. (newPosBelow is on the same line as p1) // Retrieve the rectangle of posBelow and use its y and height // value to calculate the final height of the multiple line // spanning rectangle. Rectangle end = ui.modelToView(t, posBelow); grow.height = end.y + end.height - grow.y; paintHighlight(g, grow); } // Paint last line from its beginning to the position of p1. l1.width = l1.x + l1.width - rect.x; l1.x = rect.x; g.fillRect(l1.x, l1.y, l1.width, l1.height); } } catch (BadLocationException ex) { AssertionError err = new AssertionError("Unexpected bad location exception"); err.initCause(ex); throw err; } }
| 11,363
|
public void paint(Graphics g, int p0, int p1, Shape bounds, JTextComponent t) { if (p0 == p1) return; Rectangle rect = bounds.getBounds(); if (color == null) g.setColor(t.getSelectionColor()); else g.setColor(color); TextUI ui = t.getUI(); try { Rectangle l0 = ui.modelToView(t, p0, null); Rectangle l1 = ui.modelToView(t, p1, null); // Note: The computed locations may lie outside of the allocation // area if the text is scrolled. if (l0.y == l1.y) { SwingUtilities.computeUnion(l0.x, l0.y, l0.width, l0.height, l1); // Paint only inside the allocation area. SwingUtilities.computeIntersection(rect.x, rect.y, rect.width, rect.height, l1); paintHighlight(g, l1); } else { // 1. The line of p0 is painted from the position of p0 // to the right border. // 2. All lines between the ones where p0 and p1 lie on // are completely highlighted. The allocation area is used to find // out the bounds. // 3. The final line is painted from the left border to the // position of p1. // Highlight first line until the end. // If rect.x is non-zero the calculation will properly adjust the // area to be painted. l0.x -= rect.x; l0.width = rect.width - l0.x - rect.x; paintHighlight(g, l0); int posBelow = Utilities.getPositionBelow(t, p0, l0.x); int p1RowStart = Utilities.getRowStart(t, p1); if (posBelow != -1 && posBelow != p0 && Utilities.getRowStart(t, posBelow) != p1RowStart) { Rectangle grow = ui.modelToView(t, posBelow); grow.x = rect.x; grow.width = rect.width; // Find further lines which have to be highlighted completely. int nextPosBelow = posBelow; while (nextPosBelow != -1 && Utilities.getRowStart(t, nextPosBelow) != p1RowStart) { posBelow = nextPosBelow; nextPosBelow = Utilities.getPositionBelow(t, posBelow, l0.x); if (nextPosBelow == posBelow) break; } // Now posBelow is an offset on the last line which has to be painted // completely. (newPosBelow is on the same line as p1) // Retrieve the rectangle of posBelow and use its y and height // value to calculate the final height of the multiple line // spanning rectangle. Rectangle end = ui.modelToView(t, posBelow); grow.height = end.y + end.height - grow.y; paintHighlight(g, grow); } // Paint last line from its beginning to the position of p1. l1.width = l1.x + l1.width - rect.x; l1.x = rect.x; paintHighlight(g, l1); } } catch (BadLocationException ex) { AssertionError err = new AssertionError("Unexpected bad location exception"); err.initCause(ex); throw err; } }
|
public void paint(Graphics g, int p0, int p1, Shape bounds, JTextComponent t) { if (p0 == p1) return; Rectangle rect = bounds.getBounds(); if (color == null) g.setColor(t.getSelectionColor()); else g.setColor(color); TextUI ui = t.getUI(); try { Rectangle l0 = ui.modelToView(t, p0, null); Rectangle l1 = ui.modelToView(t, p1, null); // Note: The computed locations may lie outside of the allocation // area if the text is scrolled. if (l0.y == l1.y) { SwingUtilities.computeUnion(l0.x, l0.y, l0.width, l0.height, l1); // Paint only inside the allocation area. SwingUtilities.computeIntersection(rect.x, rect.y, rect.width, rect.height, l1); paintHighlight(g, l1); } else { // 1. The line of p0 is painted from the position of p0 // to the right border. // 2. All lines between the ones where p0 and p1 lie on // are completely highlighted. The allocation area is used to find // out the bounds. // 3. The final line is painted from the left border to the // position of p1. // Highlight first line until the end. // If rect.x is non-zero the calculation will properly adjust the // area to be painted. l0.x -= rect.x; l0.width = rect.width - l0.x - rect.x; paintHighlight(g, l0); int posBelow = Utilities.getPositionBelow(t, p0, l0.x); int p1RowStart = Utilities.getRowStart(t, p1); if (posBelow != -1 && posBelow != p0 && Utilities.getRowStart(t, posBelow) != p1RowStart) { Rectangle grow = ui.modelToView(t, posBelow); grow.x = rect.x; grow.width = rect.width; // Find further lines which have to be highlighted completely. int nextPosBelow = posBelow; while (nextPosBelow != -1 && Utilities.getRowStart(t, nextPosBelow) != p1RowStart) { posBelow = nextPosBelow; nextPosBelow = Utilities.getPositionBelow(t, posBelow, l0.x); if (nextPosBelow == posBelow) break; } // Now posBelow is an offset on the last line which has to be painted // completely. (newPosBelow is on the same line as p1) // Retrieve the rectangle of posBelow and use its y and height // value to calculate the final height of the multiple line // spanning rectangle. Rectangle end = ui.modelToView(t, posBelow); grow.height = end.y + end.height - grow.y; paintHighlight(g, grow); } // Paint last line from its beginning to the position of p1. l1.width = l1.x + l1.width - rect.x; l1.x = rect.x; paintHighlight(g, l1); } } catch (BadLocationException ex) { AssertionError err = new AssertionError("Unexpected bad location exception"); err.initCause(ex); throw err; } }
| 11,364
|
public void paint(Graphics g, int p0, int p1, Shape bounds, JTextComponent t) { if (p0 == p1) return; Rectangle rect = bounds.getBounds(); if (color == null) g.setColor(t.getSelectionColor()); else g.setColor(color); TextUI ui = t.getUI(); try { Rectangle l0 = ui.modelToView(t, p0, null); Rectangle l1 = ui.modelToView(t, p1, null); // Note: The computed locations may lie outside of the allocation // area if the text is scrolled. if (l0.y == l1.y) { SwingUtilities.computeUnion(l0.x, l0.y, l0.width, l0.height, l1); // Paint only inside the allocation area. SwingUtilities.computeIntersection(rect.x, rect.y, rect.width, rect.height, l1); paintHighlight(g, l1); } else { // 1. The line of p0 is painted from the position of p0 // to the right border. // 2. All lines between the ones where p0 and p1 lie on // are completely highlighted. The allocation area is used to find // out the bounds. // 3. The final line is painted from the left border to the // position of p1. // Highlight first line until the end. // If rect.x is non-zero the calculation will properly adjust the // area to be painted. l0.x -= rect.x; l0.width = rect.width - l0.x - rect.x; paintHighlight(g, l0); int posBelow = Utilities.getPositionBelow(t, p0, l0.x); int p1RowStart = Utilities.getRowStart(t, p1); if (posBelow != -1 && posBelow != p0 && Utilities.getRowStart(t, posBelow) != p1RowStart) { Rectangle grow = ui.modelToView(t, posBelow); grow.x = rect.x; grow.width = rect.width; // Find further lines which have to be highlighted completely. int nextPosBelow = posBelow; while (nextPosBelow != -1 && Utilities.getRowStart(t, nextPosBelow) != p1RowStart) { posBelow = nextPosBelow; nextPosBelow = Utilities.getPositionBelow(t, posBelow, l0.x); if (nextPosBelow == posBelow) break; } // Now posBelow is an offset on the last line which has to be painted // completely. (newPosBelow is on the same line as p1) // Retrieve the rectangle of posBelow and use its y and height // value to calculate the final height of the multiple line // spanning rectangle. Rectangle end = ui.modelToView(t, posBelow); grow.height = end.y + end.height - grow.y; paintHighlight(g, grow); } // Paint last line from its beginning to the position of p1. l1.width = l1.x + l1.width - rect.x; l1.x = rect.x; paintHighlight(g, l1); } } catch (BadLocationException ex) { AssertionError err = new AssertionError("Unexpected bad location exception"); err.initCause(ex); throw err; } }
|
public void paint(Graphics g, int p0, int p1, Shape bounds, JTextComponent t) { if (p0 == p1) return; Rectangle rect = bounds.getBounds(); if (color == null) g.setColor(t.getSelectionColor()); else g.setColor(color); TextUI ui = t.getUI(); try { Rectangle l0 = ui.modelToView(t, p0, null); Rectangle l1 = ui.modelToView(t, p1, null); // Note: The computed locations may lie outside of the allocation // area if the text is scrolled. if (l0.y == l1.y) { SwingUtilities.computeUnion(l0.x, l0.y, l0.width, l0.height, l1); // Paint only inside the allocation area. SwingUtilities.computeIntersection(rect.x, rect.y, rect.width, rect.height, l1); paintHighlight(g, l1); } else { // 1. The line of p0 is painted from the position of p0 // to the right border. // 2. All lines between the ones where p0 and p1 lie on // are completely highlighted. The allocation area is used to find // out the bounds. // 3. The final line is painted from the left border to the // position of p1. // Highlight first line until the end. // If rect.x is non-zero the calculation will properly adjust the // area to be painted. l0.x -= rect.x; l0.width = rect.width - l0.x - rect.x; paintHighlight(g, l0); int posBelow = Utilities.getPositionBelow(t, p0, l0.x); int p1RowStart = Utilities.getRowStart(t, p1); if (posBelow != -1 && posBelow != p0 && Utilities.getRowStart(t, posBelow) != p1RowStart) { Rectangle grow = ui.modelToView(t, posBelow); grow.x = rect.x; grow.width = rect.width; // Find further lines which have to be highlighted completely. int nextPosBelow = posBelow; while (nextPosBelow != -1 && Utilities.getRowStart(t, nextPosBelow) != p1RowStart) { posBelow = nextPosBelow; nextPosBelow = Utilities.getPositionBelow(t, posBelow, l0.x); if (nextPosBelow == posBelow) break; } // Now posBelow is an offset on the last line which has to be painted // completely. (newPosBelow is on the same line as p1) // Retrieve the rectangle of posBelow and use its y and height // value to calculate the final height of the multiple line // spanning rectangle. Rectangle end = ui.modelToView(t, posBelow); grow.height = end.y + end.height - grow.y; paintHighlight(g, grow); } // Paint last line from its beginning to the position of p1. l1.width = l1.x + l1.width - rect.x; l1.x = rect.x; paintHighlight(g, l1); } } catch (BadLocationException ex) { AssertionError err = new AssertionError("Unexpected bad location exception"); err.initCause(ex); throw err; } }
| 11,365
|
public Shape paintLayer(Graphics g, int p0, int p1, Shape bounds, JTextComponent c, View view) { throw new InternalError(); }
|
public Shape paintLayer(Graphics g, int p0, int p1, Shape bounds, JTextComponent c, View view) { Color col = getColor(); if (col == null) col = c.getSelectionColor(); g.setColor(col); Rectangle rect = null; if (p0 == view.getStartOffset() && p1 == view.getEndOffset()) { rect = bounds instanceof Rectangle ? (Rectangle) bounds : bounds.getBounds(); } else { try { Shape s = view.modelToView(p0, Position.Bias.Forward, p1, Position.Bias.Backward, bounds); rect = s instanceof Rectangle ? (Rectangle) s : s.getBounds(); } catch (BadLocationException ex) { } } if (rect != null) { g.fillRect(rect.x, rect.y, rect.width, rect.height); } return rect; }
| 11,366
|
public HighlightEntry(int p0, int p1, Highlighter.HighlightPainter painter) { this.p0 = p0; this.p1 = p1; this.painter = painter; }
|
public HighlightEntry(Position p0, Position p1, Highlighter.HighlightPainter painter) { this.p0 = p0; this.p1 = p1; this.painter = painter; }
| 11,367
|
public int getEndOffset() { return p1; }
|
public int getEndOffset() { return p1.getOffset(); }
| 11,368
|
public int getStartOffset() { return p0; }
|
public int getStartOffset() { return p0.getOffset(); }
| 11,369
|
public Object addHighlight(int p0, int p1, Highlighter.HighlightPainter painter) throws BadLocationException { checkPositions(p0, p1); HighlightEntry entry = new HighlightEntry(p0, p1, painter); highlights.add(entry); textComponent.getUI().damageRange(textComponent, p0, p1); return entry; }
|
public Object addHighlight(int p0, int p1, Highlighter.HighlightPainter painter) throws BadLocationException { checkPositions(p0, p1); HighlightEntry entry = new HighlightEntry(p0, p1, painter); highlights.add(entry); textComponent.getUI().damageRange(textComponent, p0, p1); return entry; }
| 11,370
|
public Object addHighlight(int p0, int p1, Highlighter.HighlightPainter painter) throws BadLocationException { checkPositions(p0, p1); HighlightEntry entry = new HighlightEntry(p0, p1, painter); highlights.add(entry); textComponent.getUI().damageRange(textComponent, p0, p1); return entry; }
|
public Object addHighlight(int p0, int p1, Highlighter.HighlightPainter painter) throws BadLocationException { checkPositions(p0, p1); HighlightEntry entry; Document doc = textComponent.getDocument(); Position pos0 = doc.createPosition(p0); Position pos1 = doc.createPosition(p1); if (getDrawsLayeredHighlights() && painter instanceof LayerPainter) entry = new LayerHighlightEntry(pos0, pos1, painter); else entry = new HighlightEntry(pos0, pos1, painter); highlights.add(entry); textComponent.getUI().damageRange(textComponent, p0, p1); return entry; }
| 11,371
|
public void changeHighlight(Object tag, int n0, int n1) throws BadLocationException { int o0, o1; checkPositions(n0, n1); HighlightEntry entry = (HighlightEntry) tag; o0 = entry.p0; o1 = entry.p1; // Prevent useless write & repaint operations. if (o0 == n0 && o1 == n1) return; entry.p0 = n0; entry.p1 = n1; TextUI ui = textComponent.getUI(); // Special situation where the old area has to be cleared simply. if (n0 == n1) ui.damageRange(textComponent, o0, o1); // Calculates the areas where a change is really neccessary else if ((o1 > n0 && o1 <= n1) || (n1 > o0 && n1 <= o1)) { // [fds, fde) - the first damage region // [sds, sde] - the second damage region int fds, sds; int fde, sde; // Calculate first damaged region. if(o0 < n0) { // Damaged region will be cleared as // the old highlight region starts first. fds = o0; fde = n0; } else { // Damaged region will be painted as // the new highlight region starts first. fds = n0; fde = o0; } if (o1 < n1) { // Final region will be painted as the // old highlight region finishes first sds = o1; sde = n1; } else { // Final region will be cleared as the // new highlight region finishes first. sds = n1; sde = o1; } // If there is no undamaged region in between // call damageRange only once. if (fde == sds) ui.damageRange(textComponent, fds, sde); else { if (fds != fde) ui.damageRange(textComponent, fds, fde); if (sds != sde) ui.damageRange(textComponent, sds, sde); } } else { // The two regions do not overlap. So mark // both areas as damaged. ui.damageRange(textComponent, o0, o1); ui.damageRange(textComponent, n0, n1); } }
|
public void changeHighlight(Object tag, int n0, int n1) throws BadLocationException { int o0, o1; checkPositions(n0, n1); HighlightEntry entry = (HighlightEntry) tag; o0 = entry.p0; o1 = entry.p1; // Prevent useless write & repaint operations. if (o0 == n0 && o1 == n1) return; entry.p0 = n0; entry.p1 = n1; TextUI ui = textComponent.getUI(); // Special situation where the old area has to be cleared simply. if (n0 == n1) ui.damageRange(textComponent, o0, o1); // Calculates the areas where a change is really neccessary else if ((o1 > n0 && o1 <= n1) || (n1 > o0 && n1 <= o1)) { // [fds, fde) - the first damage region // [sds, sde] - the second damage region int fds, sds; int fde, sde; // Calculate first damaged region. if(o0 < n0) { // Damaged region will be cleared as // the old highlight region starts first. fds = o0; fde = n0; } else { // Damaged region will be painted as // the new highlight region starts first. fds = n0; fde = o0; } if (o1 < n1) { // Final region will be painted as the // old highlight region finishes first sds = o1; sde = n1; } else { // Final region will be cleared as the // new highlight region finishes first. sds = n1; sde = o1; } // If there is no undamaged region in between // call damageRange only once. if (fde == sds) ui.damageRange(textComponent, fds, sde); else { if (fds != fde) ui.damageRange(textComponent, fds, fde); if (sds != sde) ui.damageRange(textComponent, sds, sde); } } else { // The two regions do not overlap. So mark // both areas as damaged. ui.damageRange(textComponent, o0, o1); ui.damageRange(textComponent, n0, n1); } }
| 11,372
|
public void changeHighlight(Object tag, int n0, int n1) throws BadLocationException { int o0, o1; checkPositions(n0, n1); HighlightEntry entry = (HighlightEntry) tag; o0 = entry.p0; o1 = entry.p1; // Prevent useless write & repaint operations. if (o0 == n0 && o1 == n1) return; entry.p0 = n0; entry.p1 = n1; TextUI ui = textComponent.getUI(); // Special situation where the old area has to be cleared simply. if (n0 == n1) ui.damageRange(textComponent, o0, o1); // Calculates the areas where a change is really neccessary else if ((o1 > n0 && o1 <= n1) || (n1 > o0 && n1 <= o1)) { // [fds, fde) - the first damage region // [sds, sde] - the second damage region int fds, sds; int fde, sde; // Calculate first damaged region. if(o0 < n0) { // Damaged region will be cleared as // the old highlight region starts first. fds = o0; fde = n0; } else { // Damaged region will be painted as // the new highlight region starts first. fds = n0; fde = o0; } if (o1 < n1) { // Final region will be painted as the // old highlight region finishes first sds = o1; sde = n1; } else { // Final region will be cleared as the // new highlight region finishes first. sds = n1; sde = o1; } // If there is no undamaged region in between // call damageRange only once. if (fde == sds) ui.damageRange(textComponent, fds, sde); else { if (fds != fde) ui.damageRange(textComponent, fds, fde); if (sds != sde) ui.damageRange(textComponent, sds, sde); } } else { // The two regions do not overlap. So mark // both areas as damaged. ui.damageRange(textComponent, o0, o1); ui.damageRange(textComponent, n0, n1); } }
|
public void changeHighlight(Object tag, int n0, int n1) throws BadLocationException { int o0, o1; checkPositions(n0, n1); HighlightEntry entry = (HighlightEntry) tag; o0 = entry.p0; o1 = entry.p1; // Prevent useless write & repaint operations. if (o0 == n0 && o1 == n1) return; entry.p0 = n0; entry.p1 = n1; TextUI ui = textComponent.getUI(); // Special situation where the old area has to be cleared simply. if (n0 == n1) ui.damageRange(textComponent, o0, o1); // Calculates the areas where a change is really neccessary else if ((o1 > n0 && o1 <= n1) || (n1 > o0 && n1 <= o1)) { // [fds, fde) - the first damage region // [sds, sde] - the second damage region int fds, sds; int fde, sde; // Calculate first damaged region. if(o0 < n0) { // Damaged region will be cleared as // the old highlight region starts first. fds = o0; fde = n0; } else { // Damaged region will be painted as // the new highlight region starts first. fds = n0; fde = o0; } if (o1 < n1) { // Final region will be painted as the // old highlight region finishes first sds = o1; sde = n1; } else { // Final region will be cleared as the // new highlight region finishes first. sds = n1; sde = o1; } // If there is no undamaged region in between // call damageRange only once. if (fde == sds) ui.damageRange(textComponent, fds, sde); else { if (fds != fde) ui.damageRange(textComponent, fds, fde); if (sds != sde) ui.damageRange(textComponent, sds, sde); } } else { // The two regions do not overlap. So mark // both areas as damaged. ui.damageRange(textComponent, o0, o1); ui.damageRange(textComponent, n0, n1); } }
| 11,373
|
public void changeHighlight(Object tag, int n0, int n1) throws BadLocationException { int o0, o1; checkPositions(n0, n1); HighlightEntry entry = (HighlightEntry) tag; o0 = entry.p0; o1 = entry.p1; // Prevent useless write & repaint operations. if (o0 == n0 && o1 == n1) return; entry.p0 = n0; entry.p1 = n1; TextUI ui = textComponent.getUI(); // Special situation where the old area has to be cleared simply. if (n0 == n1) ui.damageRange(textComponent, o0, o1); // Calculates the areas where a change is really neccessary else if ((o1 > n0 && o1 <= n1) || (n1 > o0 && n1 <= o1)) { // [fds, fde) - the first damage region // [sds, sde] - the second damage region int fds, sds; int fde, sde; // Calculate first damaged region. if(o0 < n0) { // Damaged region will be cleared as // the old highlight region starts first. fds = o0; fde = n0; } else { // Damaged region will be painted as // the new highlight region starts first. fds = n0; fde = o0; } if (o1 < n1) { // Final region will be painted as the // old highlight region finishes first sds = o1; sde = n1; } else { // Final region will be cleared as the // new highlight region finishes first. sds = n1; sde = o1; } // If there is no undamaged region in between // call damageRange only once. if (fde == sds) ui.damageRange(textComponent, fds, sde); else { if (fds != fde) ui.damageRange(textComponent, fds, fde); if (sds != sde) ui.damageRange(textComponent, sds, sde); } } else { // The two regions do not overlap. So mark // both areas as damaged. ui.damageRange(textComponent, o0, o1); ui.damageRange(textComponent, n0, n1); } }
|
public void changeHighlight(Object tag, int n0, int n1) throws BadLocationException { int o0, o1; checkPositions(n0, n1); HighlightEntry entry = (HighlightEntry) tag; o0 = entry.p0; o1 = entry.p1; // Prevent useless write & repaint operations. if (o0 == n0 && o1 == n1) return; entry.p0 = n0; entry.p1 = n1; TextUI ui = textComponent.getUI(); // Special situation where the old area has to be cleared simply. if (n0 == n1) ui.damageRange(textComponent, o0, o1); // Calculates the areas where a change is really neccessary else if ((o1 > n0 && o1 <= n1) || (n1 > o0 && n1 <= o1)) { // [fds, fde) - the first damage region // [sds, sde] - the second damage region int fds, sds; int fde, sde; // Calculate first damaged region. if(o0 < n0) { // Damaged region will be cleared as // the old highlight region starts first. fds = o0; fde = n0; } else { // Damaged region will be painted as // the new highlight region starts first. fds = n0; fde = o0; } if (o1 < n1) { // Final region will be painted as the // old highlight region finishes first sds = o1; sde = n1; } else { // Final region will be cleared as the // new highlight region finishes first. sds = n1; sde = o1; } // If there is no undamaged region in between // call damageRange only once. if (fde == sds) ui.damageRange(textComponent, fds, sde); else { if (fds != fde) ui.damageRange(textComponent, fds, fde); if (sds != sde) ui.damageRange(textComponent, sds, sde); } } else { // The two regions do not overlap. So mark // both areas as damaged. ui.damageRange(textComponent, o0, o1); ui.damageRange(textComponent, n0, n1); } }
| 11,374
|
public void changeHighlight(Object tag, int n0, int n1) throws BadLocationException { int o0, o1; checkPositions(n0, n1); HighlightEntry entry = (HighlightEntry) tag; o0 = entry.p0; o1 = entry.p1; // Prevent useless write & repaint operations. if (o0 == n0 && o1 == n1) return; entry.p0 = n0; entry.p1 = n1; TextUI ui = textComponent.getUI(); // Special situation where the old area has to be cleared simply. if (n0 == n1) ui.damageRange(textComponent, o0, o1); // Calculates the areas where a change is really neccessary else if ((o1 > n0 && o1 <= n1) || (n1 > o0 && n1 <= o1)) { // [fds, fde) - the first damage region // [sds, sde] - the second damage region int fds, sds; int fde, sde; // Calculate first damaged region. if(o0 < n0) { // Damaged region will be cleared as // the old highlight region starts first. fds = o0; fde = n0; } else { // Damaged region will be painted as // the new highlight region starts first. fds = n0; fde = o0; } if (o1 < n1) { // Final region will be painted as the // old highlight region finishes first sds = o1; sde = n1; } else { // Final region will be cleared as the // new highlight region finishes first. sds = n1; sde = o1; } // If there is no undamaged region in between // call damageRange only once. if (fde == sds) ui.damageRange(textComponent, fds, sde); else { if (fds != fde) ui.damageRange(textComponent, fds, fde); if (sds != sde) ui.damageRange(textComponent, sds, sde); } } else { // The two regions do not overlap. So mark // both areas as damaged. ui.damageRange(textComponent, o0, o1); ui.damageRange(textComponent, n0, n1); } }
|
public void changeHighlight(Object tag, int n0, int n1) throws BadLocationException { int o0, o1; checkPositions(n0, n1); HighlightEntry entry = (HighlightEntry) tag; o0 = entry.p0; o1 = entry.p1; // Prevent useless write & repaint operations. if (o0 == n0 && o1 == n1) return; entry.p0 = n0; entry.p1 = n1; TextUI ui = textComponent.getUI(); // Special situation where the old area has to be cleared simply. if (n0 == n1) ui.damageRange(textComponent, o0, o1); // Calculates the areas where a change is really neccessary else if ((o1 > n0 && o1 <= n1) || (n1 > o0 && n1 <= o1)) { // [fds, fde) - the first damage region // [sds, sde] - the second damage region int fds, sds; int fde, sde; // Calculate first damaged region. if(o0 < n0) { // Damaged region will be cleared as // the old highlight region starts first. fds = o0; fde = n0; } else { // Damaged region will be painted as // the new highlight region starts first. fds = n0; fde = o0; } if (o1 < n1) { // Final region will be painted as the // old highlight region finishes first sds = o1; sde = n1; } else { // Final region will be cleared as the // new highlight region finishes first. sds = n1; sde = o1; } // If there is no undamaged region in between // call damageRange only once. if (fde == sds) ui.damageRange(textComponent, fds, sde); else { if (fds != fde) ui.damageRange(textComponent, fds, fde); if (sds != sde) ui.damageRange(textComponent, sds, sde); } } else { // The two regions do not overlap. So mark // both areas as damaged. ui.damageRange(textComponent, o0, o1); ui.damageRange(textComponent, n0, n1); } }
| 11,375
|
public void changeHighlight(Object tag, int n0, int n1) throws BadLocationException { int o0, o1; checkPositions(n0, n1); HighlightEntry entry = (HighlightEntry) tag; o0 = entry.p0; o1 = entry.p1; // Prevent useless write & repaint operations. if (o0 == n0 && o1 == n1) return; entry.p0 = n0; entry.p1 = n1; TextUI ui = textComponent.getUI(); // Special situation where the old area has to be cleared simply. if (n0 == n1) ui.damageRange(textComponent, o0, o1); // Calculates the areas where a change is really neccessary else if ((o1 > n0 && o1 <= n1) || (n1 > o0 && n1 <= o1)) { // [fds, fde) - the first damage region // [sds, sde] - the second damage region int fds, sds; int fde, sde; // Calculate first damaged region. if(o0 < n0) { // Damaged region will be cleared as // the old highlight region starts first. fds = o0; fde = n0; } else { // Damaged region will be painted as // the new highlight region starts first. fds = n0; fde = o0; } if (o1 < n1) { // Final region will be painted as the // old highlight region finishes first sds = o1; sde = n1; } else { // Final region will be cleared as the // new highlight region finishes first. sds = n1; sde = o1; } // If there is no undamaged region in between // call damageRange only once. if (fde == sds) ui.damageRange(textComponent, fds, sde); else { if (fds != fde) ui.damageRange(textComponent, fds, fde); if (sds != sde) ui.damageRange(textComponent, sds, sde); } } else { // The two regions do not overlap. So mark // both areas as damaged. ui.damageRange(textComponent, o0, o1); ui.damageRange(textComponent, n0, n1); } }
|
public void changeHighlight(Object tag, int n0, int n1) throws BadLocationException { int o0, o1; checkPositions(n0, n1); HighlightEntry entry = (HighlightEntry) tag; o0 = entry.p0; o1 = entry.p1; // Prevent useless write & repaint operations. if (o0 == n0 && o1 == n1) return; entry.p0 = n0; entry.p1 = n1; TextUI ui = textComponent.getUI(); // Special situation where the old area has to be cleared simply. if (n0 == n1) ui.damageRange(textComponent, o0, o1); // Calculates the areas where a change is really neccessary else if (n1 == p1) if ((o1 > n0 && o1 <= n1) || (n1 > o0 && n1 <= o1)) { // [fds, fde) - the first damage region // [sds, sde] - the second damage region int fds, sds; int fde, sde; // Calculate first damaged region. if(o0 < n0) { // Damaged region will be cleared as // the old highlight region starts first. fds = o0; fde = n0; } else if (n1 == p1) { // Damaged region will be painted as // the new highlight region starts first. fds = n0; fde = o0; } if (o1 < n1) { // Final region will be painted as the // old highlight region finishes first sds = o1; sde = n1; } else if (n1 == p1) { // Final region will be cleared as the // new highlight region finishes first. sds = n1; sde = o1; } // If there is no undamaged region in between // call damageRange only once. if (fde == sds) ui.damageRange(textComponent, fds, sde); else if (n1 == p1) { if (fds != fde) ui.damageRange(textComponent, fds, fde); if (sds != sde) ui.damageRange(textComponent, sds, sde); } } else if (n1 == p1) { // The two regions do not overlap. So mark // both areas as damaged. ui.damageRange(textComponent, o0, o1); ui.damageRange(textComponent, n0, n1); } }
| 11,376
|
public void changeHighlight(Object tag, int n0, int n1) throws BadLocationException { int o0, o1; checkPositions(n0, n1); HighlightEntry entry = (HighlightEntry) tag; o0 = entry.p0; o1 = entry.p1; // Prevent useless write & repaint operations. if (o0 == n0 && o1 == n1) return; entry.p0 = n0; entry.p1 = n1; TextUI ui = textComponent.getUI(); // Special situation where the old area has to be cleared simply. if (n0 == n1) ui.damageRange(textComponent, o0, o1); // Calculates the areas where a change is really neccessary else if ((o1 > n0 && o1 <= n1) || (n1 > o0 && n1 <= o1)) { // [fds, fde) - the first damage region // [sds, sde] - the second damage region int fds, sds; int fde, sde; // Calculate first damaged region. if(o0 < n0) { // Damaged region will be cleared as // the old highlight region starts first. fds = o0; fde = n0; } else { // Damaged region will be painted as // the new highlight region starts first. fds = n0; fde = o0; } if (o1 < n1) { // Final region will be painted as the // old highlight region finishes first sds = o1; sde = n1; } else { // Final region will be cleared as the // new highlight region finishes first. sds = n1; sde = o1; } // If there is no undamaged region in between // call damageRange only once. if (fde == sds) ui.damageRange(textComponent, fds, sde); else { if (fds != fde) ui.damageRange(textComponent, fds, fde); if (sds != sde) ui.damageRange(textComponent, sds, sde); } } else { // The two regions do not overlap. So mark // both areas as damaged. ui.damageRange(textComponent, o0, o1); ui.damageRange(textComponent, n0, n1); } }
|
public void changeHighlight(Object tag, int n0, int n1) throws BadLocationException { int o0, o1; checkPositions(n0, n1); HighlightEntry entry = (HighlightEntry) tag; o0 = entry.p0; o1 = entry.p1; // Prevent useless write & repaint operations. if (o0 == n0 && o1 == n1) return; entry.p0 = n0; entry.p1 = n1; TextUI ui = textComponent.getUI(); // Special situation where the old area has to be cleared simply. if (n0 == n1) ui.damageRange(textComponent, o0, o1); // Calculates the areas where a change is really neccessary else if ((o1 > n0 && o1 <= n1) || (n1 > o0 && n1 <= o1)) { // [fds, fde) - the first damage region // [sds, sde] - the second damage region int fds, sds; int fde, sde; // Calculate first damaged region. if(o0 < n0) { // Damaged region will be cleared as // the old highlight region starts first. fds = o0; fde = n0; } else { // Damaged region will be painted as // the new highlight region starts first. fds = n0; fde = o0; } if (o1 < n1) { // Final region will be painted as the // old highlight region finishes first sds = o1; sde = n1; } else { // Final region will be cleared as the // new highlight region finishes first. sds = n1; sde = o1; } // If there is no undamaged region in between // call damageRange only once. if (fde == sds) ui.damageRange(textComponent, fds, sde); else { if (fds != fde) ui.damageRange(textComponent, fds, fde); if (sds != sde) ui.damageRange(textComponent, sds, sde); } } else { // The two regions do not overlap. So mark // both areas as damaged. ui.damageRange(textComponent, o0, o1); ui.damageRange(textComponent, n0, n1); } }
| 11,377
|
public void changeHighlight(Object tag, int n0, int n1) throws BadLocationException { int o0, o1; checkPositions(n0, n1); HighlightEntry entry = (HighlightEntry) tag; o0 = entry.p0; o1 = entry.p1; // Prevent useless write & repaint operations. if (o0 == n0 && o1 == n1) return; entry.p0 = n0; entry.p1 = n1; TextUI ui = textComponent.getUI(); // Special situation where the old area has to be cleared simply. if (n0 == n1) ui.damageRange(textComponent, o0, o1); // Calculates the areas where a change is really neccessary else if ((o1 > n0 && o1 <= n1) || (n1 > o0 && n1 <= o1)) { // [fds, fde) - the first damage region // [sds, sde] - the second damage region int fds, sds; int fde, sde; // Calculate first damaged region. if(o0 < n0) { // Damaged region will be cleared as // the old highlight region starts first. fds = o0; fde = n0; } else { // Damaged region will be painted as // the new highlight region starts first. fds = n0; fde = o0; } if (o1 < n1) { // Final region will be painted as the // old highlight region finishes first sds = o1; sde = n1; } else { // Final region will be cleared as the // new highlight region finishes first. sds = n1; sde = o1; } // If there is no undamaged region in between // call damageRange only once. if (fde == sds) ui.damageRange(textComponent, fds, sde); else { if (fds != fde) ui.damageRange(textComponent, fds, fde); if (sds != sde) ui.damageRange(textComponent, sds, sde); } } else { // The two regions do not overlap. So mark // both areas as damaged. ui.damageRange(textComponent, o0, o1); ui.damageRange(textComponent, n0, n1); } }
|
public void changeHighlight(Object tag, int n0, int n1) throws BadLocationException { int o0, o1; checkPositions(n0, n1); HighlightEntry entry = (HighlightEntry) tag; o0 = entry.p0; o1 = entry.p1; // Prevent useless write & repaint operations. if (o0 == n0 && o1 == n1) return; entry.p0 = n0; entry.p1 = n1; TextUI ui = textComponent.getUI(); // Special situation where the old area has to be cleared simply. if (n0 == n1) ui.damageRange(textComponent, p0, p1); // Calculates the areas where a change is really neccessary else if ((o1 > n0 && o1 <= n1) || (n1 > o0 && n1 <= o1)) { // [fds, fde) - the first damage region // [sds, sde] - the second damage region int fds, sds; int fde, sde; // Calculate first damaged region. if(o0 < n0) { // Damaged region will be cleared as // the old highlight region starts first. fds = o0; fde = n0; } else { // Damaged region will be painted as // the new highlight region starts first. fds = n0; fde = o0; } if (o1 < n1) { // Final region will be painted as the // old highlight region finishes first sds = o1; sde = n1; } else { // Final region will be cleared as the // new highlight region finishes first. sds = n1; sde = o1; } // If there is no undamaged region in between // call damageRange only once. if (fde == sds) ui.damageRange(textComponent, fds, sde); else { if (fds != fde) ui.damageRange(textComponent, fds, fde); if (sds != sde) ui.damageRange(textComponent, sds, sde); } } else { // The two regions do not overlap. So mark // both areas as damaged. ui.damageRange(textComponent, p0, p1); ui.damageRange(textComponent, n0, n1); } }
| 11,378
|
public void changeHighlight(Object tag, int n0, int n1) throws BadLocationException { int o0, o1; checkPositions(n0, n1); HighlightEntry entry = (HighlightEntry) tag; o0 = entry.p0; o1 = entry.p1; // Prevent useless write & repaint operations. if (o0 == n0 && o1 == n1) return; entry.p0 = n0; entry.p1 = n1; TextUI ui = textComponent.getUI(); // Special situation where the old area has to be cleared simply. if (n0 == n1) ui.damageRange(textComponent, o0, o1); // Calculates the areas where a change is really neccessary else if ((o1 > n0 && o1 <= n1) || (n1 > o0 && n1 <= o1)) { // [fds, fde) - the first damage region // [sds, sde] - the second damage region int fds, sds; int fde, sde; // Calculate first damaged region. if(o0 < n0) { // Damaged region will be cleared as // the old highlight region starts first. fds = o0; fde = n0; } else { // Damaged region will be painted as // the new highlight region starts first. fds = n0; fde = o0; } if (o1 < n1) { // Final region will be painted as the // old highlight region finishes first sds = o1; sde = n1; } else { // Final region will be cleared as the // new highlight region finishes first. sds = n1; sde = o1; } // If there is no undamaged region in between // call damageRange only once. if (fde == sds) ui.damageRange(textComponent, fds, sde); else { if (fds != fde) ui.damageRange(textComponent, fds, fde); if (sds != sde) ui.damageRange(textComponent, sds, sde); } } else { // The two regions do not overlap. So mark // both areas as damaged. ui.damageRange(textComponent, o0, o1); ui.damageRange(textComponent, n0, n1); } }
|
e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } publice.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } voide.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } changeHighlight(Objecte.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } tag,e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } inte.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } n0,e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } inte.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } n1)e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } throwse.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } BadLocationExceptione.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } {e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } inte.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } o0,e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } o1;e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } checkPositions(n0,e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } n1);e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } HighlightEntrye.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } entrye.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } =e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } (HighlightEntry)e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } tag;e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } o0e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } =e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } entry.p0;e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } o1e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } =e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } entry.p1;e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } //e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } Prevente.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } uselesse.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } writee.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } &e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } repainte.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } operations.e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } ife.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } (o0e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } ==e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } n0e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } &&e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } o1e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } ==e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } n1)e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } return;e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } entry.p0e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } =e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } n0;e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } entry.p1e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } =e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } n1;e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } TextUIe.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } uie.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } =e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } textComponent.getUI();e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } //e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } Speciale.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } situatione.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } wheree.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } thee.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } olde.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } areae.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } hase.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } toe.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } bee.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } clearede.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } simply.e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } ife.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } (n0e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } ==e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } n1)e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } ui.damageRange(textComponent,e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } o0,e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } o1);e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } //e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } Calculatese.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } thee.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } arease.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } wheree.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } ae.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } changee.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } ise.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } reallye.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } neccessarye.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } elsee.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } ife.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } ((o1e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } >e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } n0e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } &&e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } o1e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } <=e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } n1)e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } ||e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } (n1e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } >e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } o0e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } &&e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } n1e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } <=e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } o1))e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } {e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } //e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } [fds,e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } fde)e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } -e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } thee.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } firste.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } damagee.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } regione.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } //e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } [sds,e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } sde]e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } -e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } thee.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } seconde.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } damagee.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } regione.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } inte.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } fds,e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } sds;e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } inte.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } fde,e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } sde;e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } //e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } Calculatee.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } firste.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } damagede.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } region.e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } if(o0e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } <e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } n0)e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } {e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } //e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } Damagede.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } regione.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } wille.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } bee.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } clearede.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } ase.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } //e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } thee.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } olde.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } highlighte.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } regione.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } startse.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } first.e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } fdse.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } =e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } o0;e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } fdee.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } =e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } n0;e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } }e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } elsee.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } {e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } //e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } Damagede.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } regione.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } wille.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } bee.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } paintede.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } ase.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } //e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } thee.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } newe.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } highlighte.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } regione.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } startse.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } first.e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } fdse.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } =e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } n0;e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } fdee.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } =e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } o0;e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } }e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } ife.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } (o1e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } <e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } n1)e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } {e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } //e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } Finale.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } regione.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } wille.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } bee.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } paintede.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } ase.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } thee.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } //e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } olde.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } highlighte.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } regione.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } finishese.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } firste.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } sdse.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } =e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } o1;e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } sdee.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } =e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } n1;e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } }e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } elsee.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } {e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } //e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } Finale.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } regione.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } wille.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } bee.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } clearede.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } ase.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } thee.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } //e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } newe.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } highlighte.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } regione.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } finishese.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } first.e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } sdse.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } =e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } n1;e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } sdee.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } =e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } o1;e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } }e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } //e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } Ife.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } theree.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } ise.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } noe.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } undamagede.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } regione.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } ine.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } betweene.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } //e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } calle.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } damageRangee.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } onlye.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } once.e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } ife.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } (fdee.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } ==e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } sds)e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } ui.damageRange(textComponent,e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } fds,e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } sde);e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } elsee.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } {e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } ife.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } (fdse.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } !=e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } fde)e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } ui.damageRange(textComponent,e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } fds,e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } fde);e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } ife.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } (sdse.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } !=e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } sde)e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } ui.damageRange(textComponent,e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } sds,e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } sde);e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } }e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } }e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } elsee.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } {e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } //e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } Thee.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } twoe.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } regionse.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } doe.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } note.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } overlap.e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } Soe.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } marke.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } //e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } bothe.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } arease.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } ase.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } damaged.e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } ui.damageRange(textComponent,e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } o0,e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } o1);e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } ui.damageRange(textComponent,e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } n0,e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } n1);e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } }e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } e.p0 = doc.createPosition(n0); e.p1 = doc.createPosition(n1); } }
| 11,379
|
public void paint(Graphics g) { int size = highlights.size(); // Check if there are any highlights. if (size == 0) return; // Prepares the rectangle of the inner drawing area. Insets insets = textComponent.getInsets(); Shape bounds = new Rectangle(insets.left, insets.top, textComponent.getWidth() - insets.left - insets.right, textComponent.getHeight() - insets.top - insets.bottom); for (int index = 0; index < size; ++index) { HighlightEntry entry = (HighlightEntry) highlights.get(index); entry.painter.paint(g, entry.p0, entry.p1, bounds, textComponent); } }
|
public void paint(Graphics g) { int size = highlights.size(); // Check if there are any highlights. if (size == 0) return; // Prepares the rectangle of the inner drawing area. Insets insets = textComponent.getInsets(); Shape bounds = new Rectangle(insets.left, insets.top, textComponent.getWidth() - insets.left - insets.right, textComponent.getHeight() - insets.top - insets.bottom); for (int index = 0; index < size; ++index) { HighlightEntry entry = (HighlightEntry) highlights.get(index); if (! (entry instanceof LayerHighlightEntry)) entry.painter.paint(g, entry.getStartOffset(), entry.getEndOffset(), bounds, textComponent); } }
| 11,380
|
public void paintLayeredHighlights(Graphics g, int p0, int p1, Shape viewBounds, JTextComponent editor, View view) throws NotImplementedException { // TODO: Implement this properly. }
|
public void paintLayeredHighlights(Graphics g, int p0, int p1, Shape viewBounds, JTextComponent editor, View view) { // TODO: Implement this properly. }
| 11,381
|
public void paintLayeredHighlights(Graphics g, int p0, int p1, Shape viewBounds, JTextComponent editor, View view) throws NotImplementedException { // TODO: Implement this properly. }
|
for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } publicfor (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } voidfor (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } paintLayeredHighlights(Graphicsfor (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } g,for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } intfor (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } p0,for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } intfor (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } p1,for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } Shapefor (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } viewBounds,for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } JTextComponentfor (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } editor,for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } Viewfor (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } view)for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } throwsfor (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } NotImplementedExceptionfor (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } {for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } //for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } TODO:for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } Implementfor (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } thisfor (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } properly.for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } for (Iterator i = highlights.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof LayerHighlightEntry) { LayerHighlightEntry entry = (LayerHighlightEntry) o; int start = entry.getStartOffset(); int end = entry.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view); } } }
| 11,382
|
public void removeHighlight(Object tag) { highlights.remove(tag); HighlightEntry entry = (HighlightEntry) tag; textComponent.getUI().damageRange(textComponent, entry.p0, entry.p1); }
|
public void removeHighlight(Object tag) { highlights.remove(tag); HighlightEntry entry = (HighlightEntry) tag; textComponent.getUI().damageRange(textComponent, entry.p0, entry.p1); }
| 11,384
|
protected void paintComponent(Graphics g) { log.debug("paint from screen"); if (bi == null) { checkOffScreenImage(); }// screen.paintComponent3(g); Graphics2D g2 = (Graphics2D) g; // Rectangle r = g.getClipBounds(); g2.setColor(bi.colorBg); g2.fillRect(0, 0, getWidth(), getHeight()); bi.drawImageBuffer(g2); if (rubberband.isAreaSelected() && !rubberband.isDragging()) { rubberband.erase(); rubberband.draw(); } keyPad.repaint(); }
|
protected void paintComponent(Graphics g) { if (bi == null) { checkOffScreenImage(); }// screen.paintComponent3(g); Graphics2D g2 = (Graphics2D) g; // Rectangle r = g.getClipBounds(); g2.setColor(bi.colorBg); g2.fillRect(0, 0, getWidth(), getHeight()); bi.drawImageBuffer(g2); if (rubberband.isAreaSelected() && !rubberband.isDragging()) { rubberband.erase(); rubberband.draw(); } keyPad.repaint(); }
| 11,385
|
public void resizeMe() {// screen.setBounds(getDrawingBounds()); //this is from screen5250 screen.setCursorActive(false); Rectangle r = getDrawingBounds(); if (bi != null) bi.resizeScreenArea(r.width, r.height); repaint();// screen.repaintScreen(); screen.setCursorActive(true); }
|
public void resizeMe() {// screen.setBounds(getDrawingBounds()); //this is from screen5250 screen.setCursorActive(false); Rectangle r = getDrawingBounds(); if (bi != null) bi.resizeScreenArea(r.width, r.height); repaint();// screen.repaintScreen(); screen.setCursorActive(true); }
| 11,386
|
public static ComponentUI createUI(JComponent x) { return new BasicPanelUI(); }
|
public static ComponentUI createUI(JComponent x) { return new BasicPanelUI(); }
| 11,387
|
public void installDefaults(JPanel p) { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); p.setBackground(defaults.getColor("Panel.background")); p.setOpaque(true); }
|
public void installDefaults(JPanel p) { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); p.setBackground(defaults.getColor("Panel.background")); p.setOpaque(true); }
| 11,388
|
public void installUI(JComponent c) { super.installUI(c); if (c instanceof JPanel) { JPanel p = (JPanel) c; installDefaults(p); } }
|
public void installUI(JComponent c) { super.installUI(c); if (c instanceof JPanel) { JPanel p = (JPanel) c; installDefaults(p); } }
| 11,389
|
public void applyLocalizedPattern(String pattern) { String localChars = formatData.getLocalPatternChars(); pattern = applyLocalizedPattern (pattern, localChars, standardChars); applyPattern(pattern); }
|
public void applyLocalizedPattern(String pattern) { String localChars = formatData.getLocalPatternChars(); pattern = translateLocalizedPattern(pattern, localChars, standardChars); applyPattern(pattern); }
| 11,390
|
private void compileFormat(String pattern) { // Any alphabetical characters are treated as pattern characters // unless enclosed in single quotes. char thisChar; int pos; int field; FieldSizePair current = null; for (int i=0; i<pattern.length(); i++) { thisChar = pattern.charAt(i); field = formatData.getLocalPatternChars().indexOf(thisChar); if (field == -1) { current = null; if ((thisChar >= 'A' && thisChar <= 'Z') || (thisChar >= 'a' && thisChar <= 'z')) { // Not a valid letter tokens.add(new FieldSizePair(-1,0)); } else if (thisChar == '\'') { // Quoted text section; skip to next single quote pos = pattern.indexOf('\'',i+1); if (pos == -1) { // This ought to be an exception, but spec does not // let us throw one. tokens.add(new FieldSizePair(-1,0)); } if ((pos+1 < pattern.length()) && (pattern.charAt(pos+1) == '\'')) { tokens.add(pattern.substring(i+1,pos+1)); } else { tokens.add(pattern.substring(i+1,pos)); } i = pos; } else { // A special character tokens.add(new Character(thisChar)); } } else { // A valid field if ((current != null) && (field == current.field)) { current.size++; } else { current = new FieldSizePair(field,1); tokens.add(current); } } } }
|
private void compileFormat(String pattern) { // Any alphabetical characters are treated as pattern characters // unless enclosed in single quotes. char thisChar; int pos; int field; CompiledField current = null; for (int i=0; i<pattern.length(); i++) { thisChar = pattern.charAt(i); field = formatData.getLocalPatternChars().indexOf(thisChar); if (field == -1) { current = null; if ((thisChar >= 'A' && thisChar <= 'Z') || (thisChar >= 'a' && thisChar <= 'z')) { // Not a valid letter tokens.add(new FieldSizePair(-1,0)); } else if (thisChar == '\'') { // Quoted text section; skip to next single quote pos = pattern.indexOf('\'',i+1); if (pos == -1) { // This ought to be an exception, but spec does not // let us throw one. tokens.add(new FieldSizePair(-1,0)); } if ((pos+1 < pattern.length()) && (pattern.charAt(pos+1) == '\'')) { tokens.add(pattern.substring(i+1,pos+1)); } else { tokens.add(pattern.substring(i+1,pos)); } i = pos; } else { // A special character tokens.add(new Character(thisChar)); } } else { // A valid field if ((current != null) && (field == current.field)) { current.size++; } else { current = new FieldSizePair(field,1); tokens.add(current); } } } }
| 11,391
|
private void compileFormat(String pattern) { // Any alphabetical characters are treated as pattern characters // unless enclosed in single quotes. char thisChar; int pos; int field; FieldSizePair current = null; for (int i=0; i<pattern.length(); i++) { thisChar = pattern.charAt(i); field = formatData.getLocalPatternChars().indexOf(thisChar); if (field == -1) { current = null; if ((thisChar >= 'A' && thisChar <= 'Z') || (thisChar >= 'a' && thisChar <= 'z')) { // Not a valid letter tokens.add(new FieldSizePair(-1,0)); } else if (thisChar == '\'') { // Quoted text section; skip to next single quote pos = pattern.indexOf('\'',i+1); if (pos == -1) { // This ought to be an exception, but spec does not // let us throw one. tokens.add(new FieldSizePair(-1,0)); } if ((pos+1 < pattern.length()) && (pattern.charAt(pos+1) == '\'')) { tokens.add(pattern.substring(i+1,pos+1)); } else { tokens.add(pattern.substring(i+1,pos)); } i = pos; } else { // A special character tokens.add(new Character(thisChar)); } } else { // A valid field if ((current != null) && (field == current.field)) { current.size++; } else { current = new FieldSizePair(field,1); tokens.add(current); } } } }
|
private void compileFormat(String pattern) { // Any alphabetical characters are treated as pattern characters // unless enclosed in single quotes. char thisChar; int pos; int field; FieldSizePair current = null; for (int i=0; i<pattern.length(); i++) { thisChar = pattern.charAt(i); field = standardChars.indexOf(thisChar); if (field == -1) { current = null; if ((thisChar >= 'A' && thisChar <= 'Z') || (thisChar >= 'a' && thisChar <= 'z')) { // Not a valid letter tokens.add(new FieldSizePair(-1,0)); } else if (thisChar == '\'') { // Quoted text section; skip to next single quote pos = pattern.indexOf('\'',i+1); if (pos == -1) { // This ought to be an exception, but spec does not // let us throw one. tokens.add(new FieldSizePair(-1,0)); } if ((pos+1 < pattern.length()) && (pattern.charAt(pos+1) == '\'')) { tokens.add(pattern.substring(i+1,pos+1)); } else { tokens.add(pattern.substring(i+1,pos)); } i = pos; } else { // A special character tokens.add(new Character(thisChar)); } } else { // A valid field if ((current != null) && (field == current.field)) { current.size++; } else { current = new FieldSizePair(field,1); tokens.add(current); } } } }
| 11,392
|
private void compileFormat(String pattern) { // Any alphabetical characters are treated as pattern characters // unless enclosed in single quotes. char thisChar; int pos; int field; FieldSizePair current = null; for (int i=0; i<pattern.length(); i++) { thisChar = pattern.charAt(i); field = formatData.getLocalPatternChars().indexOf(thisChar); if (field == -1) { current = null; if ((thisChar >= 'A' && thisChar <= 'Z') || (thisChar >= 'a' && thisChar <= 'z')) { // Not a valid letter tokens.add(new FieldSizePair(-1,0)); } else if (thisChar == '\'') { // Quoted text section; skip to next single quote pos = pattern.indexOf('\'',i+1); if (pos == -1) { // This ought to be an exception, but spec does not // let us throw one. tokens.add(new FieldSizePair(-1,0)); } if ((pos+1 < pattern.length()) && (pattern.charAt(pos+1) == '\'')) { tokens.add(pattern.substring(i+1,pos+1)); } else { tokens.add(pattern.substring(i+1,pos)); } i = pos; } else { // A special character tokens.add(new Character(thisChar)); } } else { // A valid field if ((current != null) && (field == current.field)) { current.size++; } else { current = new FieldSizePair(field,1); tokens.add(current); } } } }
|
private void compileFormat(String pattern) { // Any alphabetical characters are treated as pattern characters // unless enclosed in single quotes. char thisChar; int pos; int field; FieldSizePair current = null; for (int i=0; i<pattern.length(); i++) { thisChar = pattern.charAt(i); field = formatData.getLocalPatternChars().indexOf(thisChar); if (field == -1) { current = null; if ((thisChar >= 'A' && thisChar <= 'Z') || (thisChar >= 'a' && thisChar <= 'z')) { // Not a valid letter tokens.add(new FieldSizePair(-1,0)); } else if (thisChar == '\'') { // Quoted text section; skip to next single quote pos = pattern.indexOf('\'',i+1); if (pos == -1) { // This ought to be an exception, but spec does not // let us throw one. tokens.add(new FieldSizePair(-1,0)); } if ((pos+1 < pattern.length()) && (pattern.charAt(pos+1) == '\'')) { tokens.add(pattern.substring(i+1,pos+1)); } else { tokens.add(pattern.substring(i+1,pos)); } i = pos; } else { // A special character tokens.add(new Character(thisChar)); } } else { // A valid field if ((current != null) && (field == current.field)) { current.size++; } else { current = new FieldSizePair(field,1); tokens.add(current); } } } }
| 11,393
|
private void compileFormat(String pattern) { // Any alphabetical characters are treated as pattern characters // unless enclosed in single quotes. char thisChar; int pos; int field; FieldSizePair current = null; for (int i=0; i<pattern.length(); i++) { thisChar = pattern.charAt(i); field = formatData.getLocalPatternChars().indexOf(thisChar); if (field == -1) { current = null; if ((thisChar >= 'A' && thisChar <= 'Z') || (thisChar >= 'a' && thisChar <= 'z')) { // Not a valid letter tokens.add(new FieldSizePair(-1,0)); } else if (thisChar == '\'') { // Quoted text section; skip to next single quote pos = pattern.indexOf('\'',i+1); if (pos == -1) { // This ought to be an exception, but spec does not // let us throw one. tokens.add(new FieldSizePair(-1,0)); } if ((pos+1 < pattern.length()) && (pattern.charAt(pos+1) == '\'')) { tokens.add(pattern.substring(i+1,pos+1)); } else { tokens.add(pattern.substring(i+1,pos)); } i = pos; } else { // A special character tokens.add(new Character(thisChar)); } } else { // A valid field if ((current != null) && (field == current.field)) { current.size++; } else { current = new FieldSizePair(field,1); tokens.add(current); } } } }
|
private void compileFormat(String pattern) { // Any alphabetical characters are treated as pattern characters // unless enclosed in single quotes. char thisChar; int pos; int field; FieldSizePair current = null; for (int i=0; i<pattern.length(); i++) { thisChar = pattern.charAt(i); field = formatData.getLocalPatternChars().indexOf(thisChar); if (field == -1) { current = null; if ((thisChar >= 'A' && thisChar <= 'Z') || (thisChar >= 'a' && thisChar <= 'z')) { // Not a valid letter tokens.add(new FieldSizePair(-1,0)); } else if (thisChar == '\'') { // Quoted text section; skip to next single quote pos = pattern.indexOf('\'',i+1); if (pos == -1) { // This ought to be an exception, but spec does not // let us throw one. tokens.add(new FieldSizePair(-1,0)); } if ((pos+1 < pattern.length()) && (pattern.charAt(pos+1) == '\'')) { tokens.add(pattern.substring(i+1,pos+1)); } else { tokens.add(pattern.substring(i+1,pos)); } i = pos; } else { // A special character tokens.add(new Character(thisChar)); } } else { // A valid field if ((current != null) && (field == current.field)) { current.size++; } else { current = new FieldSizePair(field,1); tokens.add(current); } } } }
| 11,394
|
private void compileFormat(String pattern) { // Any alphabetical characters are treated as pattern characters // unless enclosed in single quotes. char thisChar; int pos; int field; FieldSizePair current = null; for (int i=0; i<pattern.length(); i++) { thisChar = pattern.charAt(i); field = formatData.getLocalPatternChars().indexOf(thisChar); if (field == -1) { current = null; if ((thisChar >= 'A' && thisChar <= 'Z') || (thisChar >= 'a' && thisChar <= 'z')) { // Not a valid letter tokens.add(new FieldSizePair(-1,0)); } else if (thisChar == '\'') { // Quoted text section; skip to next single quote pos = pattern.indexOf('\'',i+1); if (pos == -1) { // This ought to be an exception, but spec does not // let us throw one. tokens.add(new FieldSizePair(-1,0)); } if ((pos+1 < pattern.length()) && (pattern.charAt(pos+1) == '\'')) { tokens.add(pattern.substring(i+1,pos+1)); } else { tokens.add(pattern.substring(i+1,pos)); } i = pos; } else { // A special character tokens.add(new Character(thisChar)); } } else { // A valid field if ((current != null) && (field == current.field)) { current.size++; } else { current = new FieldSizePair(field,1); tokens.add(current); } } } }
|
private void compileFormat(String pattern) { // Any alphabetical characters are treated as pattern characters // unless enclosed in single quotes. char thisChar; int pos; int field; FieldSizePair current = null; for (int i=0; i<pattern.length(); i++) { thisChar = pattern.charAt(i); field = formatData.getLocalPatternChars().indexOf(thisChar); if (field == -1) { current = null; if ((thisChar >= 'A' && thisChar <= 'Z') || (thisChar >= 'a' && thisChar <= 'z')) { // Not a valid letter tokens.add(new FieldSizePair(-1,0)); } else if (thisChar == '\'') { // Quoted text section; skip to next single quote pos = pattern.indexOf('\'',i+1); if (pos == -1) { // This ought to be an exception, but spec does not // let us throw one. tokens.add(new FieldSizePair(-1,0)); } if ((pos+1 < pattern.length()) && (pattern.charAt(pos+1) == '\'')) { tokens.add(pattern.substring(i+1,pos+1)); } else { tokens.add(pattern.substring(i+1,pos)); } i = pos; } else { // A special character tokens.add(new Character(thisChar)); } } else { // A valid field if ((current != null) && (field == current.field)) { current.size++; } else { current = new FieldSizePair(field,1); tokens.add(current); } } } }
| 11,395
|
private void formatWithAttribute(Date date, FormatBuffer buffer, FieldPosition pos) { String temp; AttributedCharacterIterator.Attribute attribute; calendar.setTime(date); // go through vector, filling in fields where applicable, else toString Iterator iter = tokens.iterator(); while (iter.hasNext()) { Object o = iter.next(); if (o instanceof FieldSizePair) { FieldSizePair p = (FieldSizePair) o; int beginIndex = buffer.length(); switch (p.field) { case ERA_FIELD: buffer.append (formatData.eras[calendar.get (Calendar.ERA)], DateFormat.Field.ERA); break; case YEAR_FIELD: // If we have two digits, then we truncate. Otherwise, we // use the size of the pattern, and zero pad. buffer.setDefaultAttribute (DateFormat.Field.YEAR); if (p.size == 2) { temp = String.valueOf (calendar.get (Calendar.YEAR)); buffer.append (temp.substring (temp.length() - 2)); } else withLeadingZeros (calendar.get (Calendar.YEAR), p.size, buffer); break; case MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MONTH); if (p.size < 3) withLeadingZeros (calendar.get (Calendar.MONTH) + 1, p.size, buffer); else if (p.size < 4) buffer.append (formatData.shortMonths[calendar.get (Calendar.MONTH)]); else buffer.append (formatData.months[calendar.get (Calendar.MONTH)]); break; case DATE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_MONTH); withLeadingZeros (calendar.get (Calendar.DATE), p.size, buffer); break; case HOUR_OF_DAY1_FIELD: // 1-24 buffer.setDefaultAttribute(DateFormat.Field.HOUR_OF_DAY1); withLeadingZeros ( ((calendar.get (Calendar.HOUR_OF_DAY) + 23) % 24) + 1, p.size, buffer); break; case HOUR_OF_DAY0_FIELD: // 0-23 buffer.setDefaultAttribute (DateFormat.Field.HOUR_OF_DAY0); withLeadingZeros (calendar.get (Calendar.HOUR_OF_DAY), p.size, buffer); break; case MINUTE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MINUTE); withLeadingZeros (calendar.get (Calendar.MINUTE), p.size, buffer); break; case SECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.SECOND); withLeadingZeros(calendar.get (Calendar.SECOND), p.size, buffer); break; case MILLISECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MILLISECOND); withLeadingZeros (calendar.get (Calendar.MILLISECOND), p.size, buffer); break; case DAY_OF_WEEK_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK); if (p.size < 4) buffer.append (formatData.shortWeekdays[calendar.get (Calendar.DAY_OF_WEEK)]); else buffer.append (formatData.weekdays[calendar.get (Calendar.DAY_OF_WEEK)]); break; case DAY_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_YEAR); withLeadingZeros (calendar.get (Calendar.DAY_OF_YEAR), p.size, buffer); break; case DAY_OF_WEEK_IN_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK_IN_MONTH); withLeadingZeros (calendar.get (Calendar.DAY_OF_WEEK_IN_MONTH), p.size, buffer); break; case WEEK_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_YEAR); withLeadingZeros (calendar.get (Calendar.WEEK_OF_YEAR), p.size, buffer); break; case WEEK_OF_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_MONTH); withLeadingZeros (calendar.get (Calendar.WEEK_OF_MONTH), p.size, buffer); break; case AM_PM_FIELD: buffer.setDefaultAttribute (DateFormat.Field.AM_PM); buffer.append (formatData.ampms[calendar.get (Calendar.AM_PM)]); break; case HOUR1_FIELD: // 1-12 buffer.setDefaultAttribute (DateFormat.Field.HOUR1); withLeadingZeros (((calendar.get (Calendar.HOUR) + 11) % 12) + 1, p.size, buffer); break; case HOUR0_FIELD: // 0-11 buffer.setDefaultAttribute (DateFormat.Field.HOUR0); withLeadingZeros (calendar.get (Calendar.HOUR), p.size, buffer); break; case TIMEZONE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.TIME_ZONE); TimeZone zone = calendar.getTimeZone(); boolean isDST = calendar.get (Calendar.DST_OFFSET) != 0; // FIXME: XXX: This should be a localized time zone. String zoneID = zone.getDisplayName (isDST, p.size > 3 ? TimeZone.LONG : TimeZone.SHORT); buffer.append (zoneID); break; default: throw new IllegalArgumentException ("Illegal pattern character " + p.field); } if (pos != null && (buffer.getDefaultAttribute() == pos.getFieldAttribute() || p.field == pos.getField())) { pos.setBeginIndex(beginIndex); pos.setEndIndex(buffer.length()); } } else { buffer.append(o.toString(), null); } } }
|
private void formatWithAttribute(Date date, FormatBuffer buffer, FieldPosition pos) { String temp; AttributedCharacterIterator.Attribute attribute; calendar.setTime(date); // go through vector, filling in fields where applicable, else toString Iterator iter = tokens.iterator(); while (iter.hasNext()) { Object o = iter.next(); if (o instanceof FieldSizePair) { FieldSizePair p = (FieldSizePair) o; int beginIndex = buffer.length(); switch (p.field) { case ERA_FIELD: buffer.append (formatData.eras[calendar.get (Calendar.ERA)], DateFormat.Field.ERA); break; case YEAR_FIELD: // If we have two digits, then we truncate. Otherwise, we // use the size of the pattern, and zero pad. buffer.setDefaultAttribute (DateFormat.Field.YEAR); if (p.size == 2) { temp = String.valueOf (calendar.get (Calendar.YEAR)); buffer.append (temp.substring (temp.length() - 2)); } else withLeadingZeros (calendar.get (Calendar.YEAR), p.size, buffer); break; case MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MONTH); if (p.size < 3) withLeadingZeros (calendar.get (Calendar.MONTH) + 1, p.size, buffer); else if (p.size < 4) buffer.append (formatData.shortMonths[calendar.get (Calendar.MONTH)]); else buffer.append (formatData.months[calendar.get (Calendar.MONTH)]); break; case DATE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_MONTH); withLeadingZeros (calendar.get (Calendar.DATE), p.size, buffer); break; case HOUR_OF_DAY1_FIELD: // 1-24 buffer.setDefaultAttribute(DateFormat.Field.HOUR_OF_DAY1); withLeadingZeros ( ((calendar.get (Calendar.HOUR_OF_DAY) + 23) % 24) + 1, p.size, buffer); break; case HOUR_OF_DAY0_FIELD: // 0-23 buffer.setDefaultAttribute (DateFormat.Field.HOUR_OF_DAY0); withLeadingZeros (calendar.get (Calendar.HOUR_OF_DAY), p.size, buffer); break; case MINUTE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MINUTE); withLeadingZeros (calendar.get (Calendar.MINUTE), p.size, buffer); break; case SECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.SECOND); withLeadingZeros(calendar.get (Calendar.SECOND), p.size, buffer); break; case MILLISECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MILLISECOND); withLeadingZeros (calendar.get (Calendar.MILLISECOND), p.size, buffer); break; case DAY_OF_WEEK_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK); if (p.size < 4) buffer.append (formatData.shortWeekdays[calendar.get (Calendar.DAY_OF_WEEK)]); else buffer.append (formatData.weekdays[calendar.get (Calendar.DAY_OF_WEEK)]); break; case DAY_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_YEAR); withLeadingZeros (calendar.get (Calendar.DAY_OF_YEAR), p.size, buffer); break; case DAY_OF_WEEK_IN_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK_IN_MONTH); withLeadingZeros (calendar.get (Calendar.DAY_OF_WEEK_IN_MONTH), p.size, buffer); break; case WEEK_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_YEAR); withLeadingZeros (calendar.get (Calendar.WEEK_OF_YEAR), p.size, buffer); break; case WEEK_OF_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_MONTH); withLeadingZeros (calendar.get (Calendar.WEEK_OF_MONTH), p.size, buffer); break; case AM_PM_FIELD: buffer.setDefaultAttribute (DateFormat.Field.AM_PM); buffer.append (formatData.ampms[calendar.get (Calendar.AM_PM)]); break; case HOUR1_FIELD: // 1-12 buffer.setDefaultAttribute (DateFormat.Field.HOUR1); withLeadingZeros (((calendar.get (Calendar.HOUR) + 11) % 12) + 1, p.size, buffer); break; case HOUR0_FIELD: // 0-11 buffer.setDefaultAttribute (DateFormat.Field.HOUR0); withLeadingZeros (calendar.get (Calendar.HOUR), p.size, buffer); break; case TIMEZONE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.TIME_ZONE); TimeZone zone = calendar.getTimeZone(); boolean isDST = calendar.get (Calendar.DST_OFFSET) != 0; // FIXME: XXX: This should be a localized time zone. String zoneID = zone.getDisplayName (isDST, p.size > 3 ? TimeZone.LONG : TimeZone.SHORT); buffer.append (zoneID); break; default: throw new IllegalArgumentException ("Illegal pattern character " + p.field); } if (pos != null && (buffer.getDefaultAttribute() == pos.getFieldAttribute() || p.field == pos.getField())) { pos.setBeginIndex(beginIndex); pos.setEndIndex(buffer.length()); } } else { buffer.append(o.toString(), null); } } }
| 11,396
|
private void formatWithAttribute(Date date, FormatBuffer buffer, FieldPosition pos) { String temp; AttributedCharacterIterator.Attribute attribute; calendar.setTime(date); // go through vector, filling in fields where applicable, else toString Iterator iter = tokens.iterator(); while (iter.hasNext()) { Object o = iter.next(); if (o instanceof FieldSizePair) { FieldSizePair p = (FieldSizePair) o; int beginIndex = buffer.length(); switch (p.field) { case ERA_FIELD: buffer.append (formatData.eras[calendar.get (Calendar.ERA)], DateFormat.Field.ERA); break; case YEAR_FIELD: // If we have two digits, then we truncate. Otherwise, we // use the size of the pattern, and zero pad. buffer.setDefaultAttribute (DateFormat.Field.YEAR); if (p.size == 2) { temp = String.valueOf (calendar.get (Calendar.YEAR)); buffer.append (temp.substring (temp.length() - 2)); } else withLeadingZeros (calendar.get (Calendar.YEAR), p.size, buffer); break; case MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MONTH); if (p.size < 3) withLeadingZeros (calendar.get (Calendar.MONTH) + 1, p.size, buffer); else if (p.size < 4) buffer.append (formatData.shortMonths[calendar.get (Calendar.MONTH)]); else buffer.append (formatData.months[calendar.get (Calendar.MONTH)]); break; case DATE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_MONTH); withLeadingZeros (calendar.get (Calendar.DATE), p.size, buffer); break; case HOUR_OF_DAY1_FIELD: // 1-24 buffer.setDefaultAttribute(DateFormat.Field.HOUR_OF_DAY1); withLeadingZeros ( ((calendar.get (Calendar.HOUR_OF_DAY) + 23) % 24) + 1, p.size, buffer); break; case HOUR_OF_DAY0_FIELD: // 0-23 buffer.setDefaultAttribute (DateFormat.Field.HOUR_OF_DAY0); withLeadingZeros (calendar.get (Calendar.HOUR_OF_DAY), p.size, buffer); break; case MINUTE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MINUTE); withLeadingZeros (calendar.get (Calendar.MINUTE), p.size, buffer); break; case SECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.SECOND); withLeadingZeros(calendar.get (Calendar.SECOND), p.size, buffer); break; case MILLISECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MILLISECOND); withLeadingZeros (calendar.get (Calendar.MILLISECOND), p.size, buffer); break; case DAY_OF_WEEK_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK); if (p.size < 4) buffer.append (formatData.shortWeekdays[calendar.get (Calendar.DAY_OF_WEEK)]); else buffer.append (formatData.weekdays[calendar.get (Calendar.DAY_OF_WEEK)]); break; case DAY_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_YEAR); withLeadingZeros (calendar.get (Calendar.DAY_OF_YEAR), p.size, buffer); break; case DAY_OF_WEEK_IN_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK_IN_MONTH); withLeadingZeros (calendar.get (Calendar.DAY_OF_WEEK_IN_MONTH), p.size, buffer); break; case WEEK_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_YEAR); withLeadingZeros (calendar.get (Calendar.WEEK_OF_YEAR), p.size, buffer); break; case WEEK_OF_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_MONTH); withLeadingZeros (calendar.get (Calendar.WEEK_OF_MONTH), p.size, buffer); break; case AM_PM_FIELD: buffer.setDefaultAttribute (DateFormat.Field.AM_PM); buffer.append (formatData.ampms[calendar.get (Calendar.AM_PM)]); break; case HOUR1_FIELD: // 1-12 buffer.setDefaultAttribute (DateFormat.Field.HOUR1); withLeadingZeros (((calendar.get (Calendar.HOUR) + 11) % 12) + 1, p.size, buffer); break; case HOUR0_FIELD: // 0-11 buffer.setDefaultAttribute (DateFormat.Field.HOUR0); withLeadingZeros (calendar.get (Calendar.HOUR), p.size, buffer); break; case TIMEZONE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.TIME_ZONE); TimeZone zone = calendar.getTimeZone(); boolean isDST = calendar.get (Calendar.DST_OFFSET) != 0; // FIXME: XXX: This should be a localized time zone. String zoneID = zone.getDisplayName (isDST, p.size > 3 ? TimeZone.LONG : TimeZone.SHORT); buffer.append (zoneID); break; default: throw new IllegalArgumentException ("Illegal pattern character " + p.field); } if (pos != null && (buffer.getDefaultAttribute() == pos.getFieldAttribute() || p.field == pos.getField())) { pos.setBeginIndex(beginIndex); pos.setEndIndex(buffer.length()); } } else { buffer.append(o.toString(), null); } } }
|
private void formatWithAttribute(Date date, FormatBuffer buffer, FieldPosition pos) { String temp; AttributedCharacterIterator.Attribute attribute; calendar.setTime(date); // go through vector, filling in fields where applicable, else toString Iterator iter = tokens.iterator(); while (iter.hasNext()) { Object o = iter.next(); if (o instanceof FieldSizePair) { FieldSizePair p = (FieldSizePair) o; int beginIndex = buffer.length(); switch (p.field) { case ERA_FIELD: buffer.append (formatData.eras[calendar.get (Calendar.ERA)], DateFormat.Field.ERA); break; case YEAR_FIELD: // If we have two digits, then we truncate. Otherwise, we // use the size of the pattern, and zero pad. buffer.setDefaultAttribute (DateFormat.Field.YEAR); if (p.size == 2) { temp = String.valueOf (calendar.get (Calendar.YEAR)); buffer.append (temp.substring (temp.length() - 2)); } else withLeadingZeros (calendar.get (Calendar.YEAR), p.size, buffer); break; case MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MONTH); if (p.size < 3) withLeadingZeros (calendar.get (Calendar.MONTH) + 1, p.size, buffer); else if (p.size < 4) buffer.append (formatData.shortMonths[calendar.get (Calendar.MONTH)]); else buffer.append (formatData.months[calendar.get (Calendar.MONTH)]); break; case DATE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_MONTH); withLeadingZeros (calendar.get (Calendar.DATE), p.size, buffer); break; case HOUR_OF_DAY1_FIELD: // 1-24 buffer.setDefaultAttribute(DateFormat.Field.HOUR_OF_DAY1); withLeadingZeros ( ((calendar.get (Calendar.HOUR_OF_DAY) + 23) % 24) + 1, p.size, buffer); break; case HOUR_OF_DAY0_FIELD: // 0-23 buffer.setDefaultAttribute (DateFormat.Field.HOUR_OF_DAY0); withLeadingZeros (calendar.get (Calendar.HOUR_OF_DAY), p.size, buffer); break; case MINUTE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MINUTE); withLeadingZeros (calendar.get (Calendar.MINUTE), p.size, buffer); break; case SECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.SECOND); withLeadingZeros(calendar.get (Calendar.SECOND), p.size, buffer); break; case MILLISECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MILLISECOND); withLeadingZeros (calendar.get (Calendar.MILLISECOND), p.size, buffer); break; case DAY_OF_WEEK_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK); if (p.size < 4) buffer.append (formatData.shortWeekdays[calendar.get (Calendar.DAY_OF_WEEK)]); else buffer.append (formatData.weekdays[calendar.get (Calendar.DAY_OF_WEEK)]); break; case DAY_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_YEAR); withLeadingZeros (calendar.get (Calendar.DAY_OF_YEAR), p.size, buffer); break; case DAY_OF_WEEK_IN_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK_IN_MONTH); withLeadingZeros (calendar.get (Calendar.DAY_OF_WEEK_IN_MONTH), p.size, buffer); break; case WEEK_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_YEAR); withLeadingZeros (calendar.get (Calendar.WEEK_OF_YEAR), p.size, buffer); break; case WEEK_OF_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_MONTH); withLeadingZeros (calendar.get (Calendar.WEEK_OF_MONTH), p.size, buffer); break; case AM_PM_FIELD: buffer.setDefaultAttribute (DateFormat.Field.AM_PM); buffer.append (formatData.ampms[calendar.get (Calendar.AM_PM)]); break; case HOUR1_FIELD: // 1-12 buffer.setDefaultAttribute (DateFormat.Field.HOUR1); withLeadingZeros (((calendar.get (Calendar.HOUR) + 11) % 12) + 1, p.size, buffer); break; case HOUR0_FIELD: // 0-11 buffer.setDefaultAttribute (DateFormat.Field.HOUR0); withLeadingZeros (calendar.get (Calendar.HOUR), p.size, buffer); break; case TIMEZONE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.TIME_ZONE); TimeZone zone = calendar.getTimeZone(); boolean isDST = calendar.get (Calendar.DST_OFFSET) != 0; // FIXME: XXX: This should be a localized time zone. String zoneID = zone.getDisplayName (isDST, p.size > 3 ? TimeZone.LONG : TimeZone.SHORT); buffer.append (zoneID); break; default: throw new IllegalArgumentException ("Illegal pattern character " + p.field); } if (pos != null && (buffer.getDefaultAttribute() == pos.getFieldAttribute() || p.field == pos.getField())) { pos.setBeginIndex(beginIndex); pos.setEndIndex(buffer.length()); } } else { buffer.append(o.toString(), null); } } }
| 11,397
|
private void formatWithAttribute(Date date, FormatBuffer buffer, FieldPosition pos) { String temp; AttributedCharacterIterator.Attribute attribute; calendar.setTime(date); // go through vector, filling in fields where applicable, else toString Iterator iter = tokens.iterator(); while (iter.hasNext()) { Object o = iter.next(); if (o instanceof FieldSizePair) { FieldSizePair p = (FieldSizePair) o; int beginIndex = buffer.length(); switch (p.field) { case ERA_FIELD: buffer.append (formatData.eras[calendar.get (Calendar.ERA)], DateFormat.Field.ERA); break; case YEAR_FIELD: // If we have two digits, then we truncate. Otherwise, we // use the size of the pattern, and zero pad. buffer.setDefaultAttribute (DateFormat.Field.YEAR); if (p.size == 2) { temp = String.valueOf (calendar.get (Calendar.YEAR)); buffer.append (temp.substring (temp.length() - 2)); } else withLeadingZeros (calendar.get (Calendar.YEAR), p.size, buffer); break; case MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MONTH); if (p.size < 3) withLeadingZeros (calendar.get (Calendar.MONTH) + 1, p.size, buffer); else if (p.size < 4) buffer.append (formatData.shortMonths[calendar.get (Calendar.MONTH)]); else buffer.append (formatData.months[calendar.get (Calendar.MONTH)]); break; case DATE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_MONTH); withLeadingZeros (calendar.get (Calendar.DATE), p.size, buffer); break; case HOUR_OF_DAY1_FIELD: // 1-24 buffer.setDefaultAttribute(DateFormat.Field.HOUR_OF_DAY1); withLeadingZeros ( ((calendar.get (Calendar.HOUR_OF_DAY) + 23) % 24) + 1, p.size, buffer); break; case HOUR_OF_DAY0_FIELD: // 0-23 buffer.setDefaultAttribute (DateFormat.Field.HOUR_OF_DAY0); withLeadingZeros (calendar.get (Calendar.HOUR_OF_DAY), p.size, buffer); break; case MINUTE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MINUTE); withLeadingZeros (calendar.get (Calendar.MINUTE), p.size, buffer); break; case SECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.SECOND); withLeadingZeros(calendar.get (Calendar.SECOND), p.size, buffer); break; case MILLISECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MILLISECOND); withLeadingZeros (calendar.get (Calendar.MILLISECOND), p.size, buffer); break; case DAY_OF_WEEK_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK); if (p.size < 4) buffer.append (formatData.shortWeekdays[calendar.get (Calendar.DAY_OF_WEEK)]); else buffer.append (formatData.weekdays[calendar.get (Calendar.DAY_OF_WEEK)]); break; case DAY_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_YEAR); withLeadingZeros (calendar.get (Calendar.DAY_OF_YEAR), p.size, buffer); break; case DAY_OF_WEEK_IN_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK_IN_MONTH); withLeadingZeros (calendar.get (Calendar.DAY_OF_WEEK_IN_MONTH), p.size, buffer); break; case WEEK_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_YEAR); withLeadingZeros (calendar.get (Calendar.WEEK_OF_YEAR), p.size, buffer); break; case WEEK_OF_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_MONTH); withLeadingZeros (calendar.get (Calendar.WEEK_OF_MONTH), p.size, buffer); break; case AM_PM_FIELD: buffer.setDefaultAttribute (DateFormat.Field.AM_PM); buffer.append (formatData.ampms[calendar.get (Calendar.AM_PM)]); break; case HOUR1_FIELD: // 1-12 buffer.setDefaultAttribute (DateFormat.Field.HOUR1); withLeadingZeros (((calendar.get (Calendar.HOUR) + 11) % 12) + 1, p.size, buffer); break; case HOUR0_FIELD: // 0-11 buffer.setDefaultAttribute (DateFormat.Field.HOUR0); withLeadingZeros (calendar.get (Calendar.HOUR), p.size, buffer); break; case TIMEZONE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.TIME_ZONE); TimeZone zone = calendar.getTimeZone(); boolean isDST = calendar.get (Calendar.DST_OFFSET) != 0; // FIXME: XXX: This should be a localized time zone. String zoneID = zone.getDisplayName (isDST, p.size > 3 ? TimeZone.LONG : TimeZone.SHORT); buffer.append (zoneID); break; default: throw new IllegalArgumentException ("Illegal pattern character " + p.field); } if (pos != null && (buffer.getDefaultAttribute() == pos.getFieldAttribute() || p.field == pos.getField())) { pos.setBeginIndex(beginIndex); pos.setEndIndex(buffer.length()); } } else { buffer.append(o.toString(), null); } } }
|
private void formatWithAttribute(Date date, FormatBuffer buffer, FieldPosition pos) { String temp; AttributedCharacterIterator.Attribute attribute; calendar.setTime(date); // go through vector, filling in fields where applicable, else toString Iterator iter = tokens.iterator(); while (iter.hasNext()) { Object o = iter.next(); if (o instanceof FieldSizePair) { FieldSizePair p = (FieldSizePair) o; int beginIndex = buffer.length(); switch (p.field) { case ERA_FIELD: buffer.append (formatData.eras[calendar.get (Calendar.ERA)], DateFormat.Field.ERA); break; case YEAR_FIELD: // If we have two digits, then we truncate. Otherwise, we // use the size of the pattern, and zero pad. buffer.setDefaultAttribute (DateFormat.Field.YEAR); if (p.size == 2) { temp = String.valueOf (calendar.get (Calendar.YEAR)); buffer.append (temp.substring (temp.length() - 2)); } else withLeadingZeros (calendar.get (Calendar.YEAR), p.size, buffer); break; case MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MONTH); if (p.size < 3) withLeadingZeros (calendar.get (Calendar.MONTH) + 1, p.size, buffer); else if (p.size < 4) buffer.append (formatData.shortMonths[calendar.get (Calendar.MONTH)]); else buffer.append (formatData.months[calendar.get (Calendar.MONTH)]); break; case DATE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_MONTH); withLeadingZeros (calendar.get (Calendar.DATE), p.size, buffer); break; case HOUR_OF_DAY1_FIELD: // 1-24 buffer.setDefaultAttribute(DateFormat.Field.HOUR_OF_DAY1); withLeadingZeros ( ((calendar.get (Calendar.HOUR_OF_DAY) + 23) % 24) + 1, p.size, buffer); break; case HOUR_OF_DAY0_FIELD: // 0-23 buffer.setDefaultAttribute (DateFormat.Field.HOUR_OF_DAY0); withLeadingZeros (calendar.get (Calendar.HOUR_OF_DAY), p.size, buffer); break; case MINUTE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MINUTE); withLeadingZeros (calendar.get (Calendar.MINUTE), p.size, buffer); break; case SECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.SECOND); withLeadingZeros(calendar.get (Calendar.SECOND), p.size, buffer); break; case MILLISECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MILLISECOND); withLeadingZeros (calendar.get (Calendar.MILLISECOND), p.size, buffer); break; case DAY_OF_WEEK_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK); if (p.size < 4) buffer.append (formatData.shortWeekdays[calendar.get (Calendar.DAY_OF_WEEK)]); else buffer.append (formatData.weekdays[calendar.get (Calendar.DAY_OF_WEEK)]); break; case DAY_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_YEAR); withLeadingZeros (calendar.get (Calendar.DAY_OF_YEAR), p.size, buffer); break; case DAY_OF_WEEK_IN_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK_IN_MONTH); withLeadingZeros (calendar.get (Calendar.DAY_OF_WEEK_IN_MONTH), p.size, buffer); break; case WEEK_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_YEAR); withLeadingZeros (calendar.get (Calendar.WEEK_OF_YEAR), p.size, buffer); break; case WEEK_OF_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_MONTH); withLeadingZeros (calendar.get (Calendar.WEEK_OF_MONTH), p.size, buffer); break; case AM_PM_FIELD: buffer.setDefaultAttribute (DateFormat.Field.AM_PM); buffer.append (formatData.ampms[calendar.get (Calendar.AM_PM)]); break; case HOUR1_FIELD: // 1-12 buffer.setDefaultAttribute (DateFormat.Field.HOUR1); withLeadingZeros (((calendar.get (Calendar.HOUR) + 11) % 12) + 1, p.size, buffer); break; case HOUR0_FIELD: // 0-11 buffer.setDefaultAttribute (DateFormat.Field.HOUR0); withLeadingZeros (calendar.get (Calendar.HOUR), p.size, buffer); break; case TIMEZONE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.TIME_ZONE); TimeZone zone = calendar.getTimeZone(); boolean isDST = calendar.get (Calendar.DST_OFFSET) != 0; // FIXME: XXX: This should be a localized time zone. String zoneID = zone.getDisplayName (isDST, p.size > 3 ? TimeZone.LONG : TimeZone.SHORT); buffer.append (zoneID); break; default: throw new IllegalArgumentException ("Illegal pattern character " + p.field); } if (pos != null && (buffer.getDefaultAttribute() == pos.getFieldAttribute() || p.field == pos.getField())) { pos.setBeginIndex(beginIndex); pos.setEndIndex(buffer.length()); } } else { buffer.append(o.toString(), null); } } }
| 11,398
|
private void formatWithAttribute(Date date, FormatBuffer buffer, FieldPosition pos) { String temp; AttributedCharacterIterator.Attribute attribute; calendar.setTime(date); // go through vector, filling in fields where applicable, else toString Iterator iter = tokens.iterator(); while (iter.hasNext()) { Object o = iter.next(); if (o instanceof FieldSizePair) { FieldSizePair p = (FieldSizePair) o; int beginIndex = buffer.length(); switch (p.field) { case ERA_FIELD: buffer.append (formatData.eras[calendar.get (Calendar.ERA)], DateFormat.Field.ERA); break; case YEAR_FIELD: // If we have two digits, then we truncate. Otherwise, we // use the size of the pattern, and zero pad. buffer.setDefaultAttribute (DateFormat.Field.YEAR); if (p.size == 2) { temp = String.valueOf (calendar.get (Calendar.YEAR)); buffer.append (temp.substring (temp.length() - 2)); } else withLeadingZeros (calendar.get (Calendar.YEAR), p.size, buffer); break; case MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MONTH); if (p.size < 3) withLeadingZeros (calendar.get (Calendar.MONTH) + 1, p.size, buffer); else if (p.size < 4) buffer.append (formatData.shortMonths[calendar.get (Calendar.MONTH)]); else buffer.append (formatData.months[calendar.get (Calendar.MONTH)]); break; case DATE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_MONTH); withLeadingZeros (calendar.get (Calendar.DATE), p.size, buffer); break; case HOUR_OF_DAY1_FIELD: // 1-24 buffer.setDefaultAttribute(DateFormat.Field.HOUR_OF_DAY1); withLeadingZeros ( ((calendar.get (Calendar.HOUR_OF_DAY) + 23) % 24) + 1, p.size, buffer); break; case HOUR_OF_DAY0_FIELD: // 0-23 buffer.setDefaultAttribute (DateFormat.Field.HOUR_OF_DAY0); withLeadingZeros (calendar.get (Calendar.HOUR_OF_DAY), p.size, buffer); break; case MINUTE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MINUTE); withLeadingZeros (calendar.get (Calendar.MINUTE), p.size, buffer); break; case SECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.SECOND); withLeadingZeros(calendar.get (Calendar.SECOND), p.size, buffer); break; case MILLISECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MILLISECOND); withLeadingZeros (calendar.get (Calendar.MILLISECOND), p.size, buffer); break; case DAY_OF_WEEK_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK); if (p.size < 4) buffer.append (formatData.shortWeekdays[calendar.get (Calendar.DAY_OF_WEEK)]); else buffer.append (formatData.weekdays[calendar.get (Calendar.DAY_OF_WEEK)]); break; case DAY_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_YEAR); withLeadingZeros (calendar.get (Calendar.DAY_OF_YEAR), p.size, buffer); break; case DAY_OF_WEEK_IN_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK_IN_MONTH); withLeadingZeros (calendar.get (Calendar.DAY_OF_WEEK_IN_MONTH), p.size, buffer); break; case WEEK_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_YEAR); withLeadingZeros (calendar.get (Calendar.WEEK_OF_YEAR), p.size, buffer); break; case WEEK_OF_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_MONTH); withLeadingZeros (calendar.get (Calendar.WEEK_OF_MONTH), p.size, buffer); break; case AM_PM_FIELD: buffer.setDefaultAttribute (DateFormat.Field.AM_PM); buffer.append (formatData.ampms[calendar.get (Calendar.AM_PM)]); break; case HOUR1_FIELD: // 1-12 buffer.setDefaultAttribute (DateFormat.Field.HOUR1); withLeadingZeros (((calendar.get (Calendar.HOUR) + 11) % 12) + 1, p.size, buffer); break; case HOUR0_FIELD: // 0-11 buffer.setDefaultAttribute (DateFormat.Field.HOUR0); withLeadingZeros (calendar.get (Calendar.HOUR), p.size, buffer); break; case TIMEZONE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.TIME_ZONE); TimeZone zone = calendar.getTimeZone(); boolean isDST = calendar.get (Calendar.DST_OFFSET) != 0; // FIXME: XXX: This should be a localized time zone. String zoneID = zone.getDisplayName (isDST, p.size > 3 ? TimeZone.LONG : TimeZone.SHORT); buffer.append (zoneID); break; default: throw new IllegalArgumentException ("Illegal pattern character " + p.field); } if (pos != null && (buffer.getDefaultAttribute() == pos.getFieldAttribute() || p.field == pos.getField())) { pos.setBeginIndex(beginIndex); pos.setEndIndex(buffer.length()); } } else { buffer.append(o.toString(), null); } } }
|
private void formatWithAttribute(Date date, FormatBuffer buffer, FieldPosition pos) { String temp; AttributedCharacterIterator.Attribute attribute; calendar.setTime(date); // go through vector, filling in fields where applicable, else toString Iterator iter = tokens.iterator(); while (iter.hasNext()) { Object o = iter.next(); if (o instanceof FieldSizePair) { FieldSizePair p = (FieldSizePair) o; int beginIndex = buffer.length(); switch (p.field) { case ERA_FIELD: buffer.append (formatData.eras[calendar.get (Calendar.ERA)], DateFormat.Field.ERA); break; case YEAR_FIELD: // If we have two digits, then we truncate. Otherwise, we // use the size of the pattern, and zero pad. buffer.setDefaultAttribute (DateFormat.Field.YEAR); if (p.size == 2) { temp = String.valueOf (calendar.get (Calendar.YEAR)); buffer.append (temp.substring (temp.length() - 2)); } else withLeadingZeros (calendar.get (Calendar.YEAR), p.size, buffer); break; case MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MONTH); if (p.size < 3) withLeadingZeros (calendar.get (Calendar.MONTH) + 1, p.size, buffer); else if (p.size < 4) buffer.append (formatData.shortMonths[calendar.get (Calendar.MONTH)]); else buffer.append (formatData.months[calendar.get (Calendar.MONTH)]); break; case DATE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_MONTH); withLeadingZeros (calendar.get (Calendar.DATE), p.size, buffer); break; case HOUR_OF_DAY1_FIELD: // 1-24 buffer.setDefaultAttribute(DateFormat.Field.HOUR_OF_DAY1); withLeadingZeros ( ((calendar.get (Calendar.HOUR_OF_DAY) + 23) % 24) + 1, p.size, buffer); break; case HOUR_OF_DAY0_FIELD: // 0-23 buffer.setDefaultAttribute (DateFormat.Field.HOUR_OF_DAY0); withLeadingZeros (calendar.get (Calendar.HOUR_OF_DAY), p.size, buffer); break; case MINUTE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MINUTE); withLeadingZeros (calendar.get (Calendar.MINUTE), p.size, buffer); break; case SECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.SECOND); withLeadingZeros(calendar.get (Calendar.SECOND), p.size, buffer); break; case MILLISECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MILLISECOND); withLeadingZeros (calendar.get (Calendar.MILLISECOND), p.size, buffer); break; case DAY_OF_WEEK_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK); if (p.size < 4) buffer.append (formatData.shortWeekdays[calendar.get (Calendar.DAY_OF_WEEK)]); else buffer.append (formatData.weekdays[calendar.get (Calendar.DAY_OF_WEEK)]); break; case DAY_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_YEAR); withLeadingZeros (calendar.get (Calendar.DAY_OF_YEAR), p.size, buffer); break; case DAY_OF_WEEK_IN_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK_IN_MONTH); withLeadingZeros (calendar.get (Calendar.DAY_OF_WEEK_IN_MONTH), p.size, buffer); break; case WEEK_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_YEAR); withLeadingZeros (calendar.get (Calendar.WEEK_OF_YEAR), p.size, buffer); break; case WEEK_OF_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_MONTH); withLeadingZeros (calendar.get (Calendar.WEEK_OF_MONTH), p.size, buffer); break; case AM_PM_FIELD: buffer.setDefaultAttribute (DateFormat.Field.AM_PM); buffer.append (formatData.ampms[calendar.get (Calendar.AM_PM)]); break; case HOUR1_FIELD: // 1-12 buffer.setDefaultAttribute (DateFormat.Field.HOUR1); withLeadingZeros (((calendar.get (Calendar.HOUR) + 11) % 12) + 1, p.size, buffer); break; case HOUR0_FIELD: // 0-11 buffer.setDefaultAttribute (DateFormat.Field.HOUR0); withLeadingZeros (calendar.get (Calendar.HOUR), p.size, buffer); break; case TIMEZONE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.TIME_ZONE); TimeZone zone = calendar.getTimeZone(); boolean isDST = calendar.get (Calendar.DST_OFFSET) != 0; // FIXME: XXX: This should be a localized time zone. String zoneID = zone.getDisplayName (isDST, p.size > 3 ? TimeZone.LONG : TimeZone.SHORT); buffer.append (zoneID); break; default: throw new IllegalArgumentException ("Illegal pattern character " + p.field); } if (pos != null && (buffer.getDefaultAttribute() == pos.getFieldAttribute() || p.field == pos.getField())) { pos.setBeginIndex(beginIndex); pos.setEndIndex(buffer.length()); } } else { buffer.append(o.toString(), null); } } }
| 11,399
|
private void formatWithAttribute(Date date, FormatBuffer buffer, FieldPosition pos) { String temp; AttributedCharacterIterator.Attribute attribute; calendar.setTime(date); // go through vector, filling in fields where applicable, else toString Iterator iter = tokens.iterator(); while (iter.hasNext()) { Object o = iter.next(); if (o instanceof FieldSizePair) { FieldSizePair p = (FieldSizePair) o; int beginIndex = buffer.length(); switch (p.field) { case ERA_FIELD: buffer.append (formatData.eras[calendar.get (Calendar.ERA)], DateFormat.Field.ERA); break; case YEAR_FIELD: // If we have two digits, then we truncate. Otherwise, we // use the size of the pattern, and zero pad. buffer.setDefaultAttribute (DateFormat.Field.YEAR); if (p.size == 2) { temp = String.valueOf (calendar.get (Calendar.YEAR)); buffer.append (temp.substring (temp.length() - 2)); } else withLeadingZeros (calendar.get (Calendar.YEAR), p.size, buffer); break; case MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MONTH); if (p.size < 3) withLeadingZeros (calendar.get (Calendar.MONTH) + 1, p.size, buffer); else if (p.size < 4) buffer.append (formatData.shortMonths[calendar.get (Calendar.MONTH)]); else buffer.append (formatData.months[calendar.get (Calendar.MONTH)]); break; case DATE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_MONTH); withLeadingZeros (calendar.get (Calendar.DATE), p.size, buffer); break; case HOUR_OF_DAY1_FIELD: // 1-24 buffer.setDefaultAttribute(DateFormat.Field.HOUR_OF_DAY1); withLeadingZeros ( ((calendar.get (Calendar.HOUR_OF_DAY) + 23) % 24) + 1, p.size, buffer); break; case HOUR_OF_DAY0_FIELD: // 0-23 buffer.setDefaultAttribute (DateFormat.Field.HOUR_OF_DAY0); withLeadingZeros (calendar.get (Calendar.HOUR_OF_DAY), p.size, buffer); break; case MINUTE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MINUTE); withLeadingZeros (calendar.get (Calendar.MINUTE), p.size, buffer); break; case SECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.SECOND); withLeadingZeros(calendar.get (Calendar.SECOND), p.size, buffer); break; case MILLISECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MILLISECOND); withLeadingZeros (calendar.get (Calendar.MILLISECOND), p.size, buffer); break; case DAY_OF_WEEK_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK); if (p.size < 4) buffer.append (formatData.shortWeekdays[calendar.get (Calendar.DAY_OF_WEEK)]); else buffer.append (formatData.weekdays[calendar.get (Calendar.DAY_OF_WEEK)]); break; case DAY_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_YEAR); withLeadingZeros (calendar.get (Calendar.DAY_OF_YEAR), p.size, buffer); break; case DAY_OF_WEEK_IN_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK_IN_MONTH); withLeadingZeros (calendar.get (Calendar.DAY_OF_WEEK_IN_MONTH), p.size, buffer); break; case WEEK_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_YEAR); withLeadingZeros (calendar.get (Calendar.WEEK_OF_YEAR), p.size, buffer); break; case WEEK_OF_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_MONTH); withLeadingZeros (calendar.get (Calendar.WEEK_OF_MONTH), p.size, buffer); break; case AM_PM_FIELD: buffer.setDefaultAttribute (DateFormat.Field.AM_PM); buffer.append (formatData.ampms[calendar.get (Calendar.AM_PM)]); break; case HOUR1_FIELD: // 1-12 buffer.setDefaultAttribute (DateFormat.Field.HOUR1); withLeadingZeros (((calendar.get (Calendar.HOUR) + 11) % 12) + 1, p.size, buffer); break; case HOUR0_FIELD: // 0-11 buffer.setDefaultAttribute (DateFormat.Field.HOUR0); withLeadingZeros (calendar.get (Calendar.HOUR), p.size, buffer); break; case TIMEZONE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.TIME_ZONE); TimeZone zone = calendar.getTimeZone(); boolean isDST = calendar.get (Calendar.DST_OFFSET) != 0; // FIXME: XXX: This should be a localized time zone. String zoneID = zone.getDisplayName (isDST, p.size > 3 ? TimeZone.LONG : TimeZone.SHORT); buffer.append (zoneID); break; default: throw new IllegalArgumentException ("Illegal pattern character " + p.field); } if (pos != null && (buffer.getDefaultAttribute() == pos.getFieldAttribute() || p.field == pos.getField())) { pos.setBeginIndex(beginIndex); pos.setEndIndex(buffer.length()); } } else { buffer.append(o.toString(), null); } } }
|
private void formatWithAttribute(Date date, FormatBuffer buffer, FieldPosition pos) { String temp; AttributedCharacterIterator.Attribute attribute; calendar.setTime(date); // go through vector, filling in fields where applicable, else toString Iterator iter = tokens.iterator(); while (iter.hasNext()) { Object o = iter.next(); if (o instanceof FieldSizePair) { FieldSizePair p = (FieldSizePair) o; int beginIndex = buffer.length(); switch (p.field) { case ERA_FIELD: buffer.append (formatData.eras[calendar.get (Calendar.ERA)], DateFormat.Field.ERA); break; case YEAR_FIELD: // If we have two digits, then we truncate. Otherwise, we // use the size of the pattern, and zero pad. buffer.setDefaultAttribute (DateFormat.Field.YEAR); if (p.size == 2) { temp = String.valueOf (calendar.get (Calendar.YEAR)); buffer.append (temp.substring (temp.length() - 2)); } else withLeadingZeros (calendar.get (Calendar.YEAR), p.size, buffer); break; case MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MONTH); if (p.size < 3) withLeadingZeros (calendar.get (Calendar.MONTH) + 1, p.size, buffer); else if (p.size < 4) buffer.append (formatData.shortMonths[calendar.get (Calendar.MONTH)]); else buffer.append (formatData.months[calendar.get (Calendar.MONTH)]); break; case DATE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_MONTH); withLeadingZeros (calendar.get (Calendar.DATE), p.size, buffer); break; case HOUR_OF_DAY1_FIELD: // 1-24 buffer.setDefaultAttribute(DateFormat.Field.HOUR_OF_DAY1); withLeadingZeros ( ((calendar.get (Calendar.HOUR_OF_DAY) + 23) % 24) + 1, p.size, buffer); break; case HOUR_OF_DAY0_FIELD: // 0-23 buffer.setDefaultAttribute (DateFormat.Field.HOUR_OF_DAY0); withLeadingZeros (calendar.get (Calendar.HOUR_OF_DAY), p.size, buffer); break; case MINUTE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MINUTE); withLeadingZeros (calendar.get (Calendar.MINUTE), p.size, buffer); break; case SECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.SECOND); withLeadingZeros(calendar.get (Calendar.SECOND), p.size, buffer); break; case MILLISECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MILLISECOND); withLeadingZeros (calendar.get (Calendar.MILLISECOND), p.size, buffer); break; case DAY_OF_WEEK_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK); if (p.size < 4) buffer.append (formatData.shortWeekdays[calendar.get (Calendar.DAY_OF_WEEK)]); else buffer.append (formatData.weekdays[calendar.get (Calendar.DAY_OF_WEEK)]); break; case DAY_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_YEAR); withLeadingZeros (calendar.get (Calendar.DAY_OF_YEAR), p.size, buffer); break; case DAY_OF_WEEK_IN_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK_IN_MONTH); withLeadingZeros (calendar.get (Calendar.DAY_OF_WEEK_IN_MONTH), p.size, buffer); break; case WEEK_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_YEAR); withLeadingZeros (calendar.get (Calendar.WEEK_OF_YEAR), p.size, buffer); break; case WEEK_OF_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_MONTH); withLeadingZeros (calendar.get (Calendar.WEEK_OF_MONTH), p.size, buffer); break; case AM_PM_FIELD: buffer.setDefaultAttribute (DateFormat.Field.AM_PM); buffer.append (formatData.ampms[calendar.get (Calendar.AM_PM)]); break; case HOUR1_FIELD: // 1-12 buffer.setDefaultAttribute (DateFormat.Field.HOUR1); withLeadingZeros (((calendar.get (Calendar.HOUR) + 11) % 12) + 1, p.size, buffer); break; case HOUR0_FIELD: // 0-11 buffer.setDefaultAttribute (DateFormat.Field.HOUR0); withLeadingZeros (calendar.get (Calendar.HOUR), p.size, buffer); break; case TIMEZONE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.TIME_ZONE); TimeZone zone = calendar.getTimeZone(); boolean isDST = calendar.get (Calendar.DST_OFFSET) != 0; // FIXME: XXX: This should be a localized time zone. String zoneID = zone.getDisplayName (isDST, p.size > 3 ? TimeZone.LONG : TimeZone.SHORT); buffer.append (zoneID); break; default: throw new IllegalArgumentException ("Illegal pattern character " + p.field); } if (pos != null && (buffer.getDefaultAttribute() == pos.getFieldAttribute() || p.field == pos.getField())) { pos.setBeginIndex(beginIndex); pos.setEndIndex(buffer.length()); } } else { buffer.append(o.toString(), null); } } }
| 11,400
|
private void formatWithAttribute(Date date, FormatBuffer buffer, FieldPosition pos) { String temp; AttributedCharacterIterator.Attribute attribute; calendar.setTime(date); // go through vector, filling in fields where applicable, else toString Iterator iter = tokens.iterator(); while (iter.hasNext()) { Object o = iter.next(); if (o instanceof FieldSizePair) { FieldSizePair p = (FieldSizePair) o; int beginIndex = buffer.length(); switch (p.field) { case ERA_FIELD: buffer.append (formatData.eras[calendar.get (Calendar.ERA)], DateFormat.Field.ERA); break; case YEAR_FIELD: // If we have two digits, then we truncate. Otherwise, we // use the size of the pattern, and zero pad. buffer.setDefaultAttribute (DateFormat.Field.YEAR); if (p.size == 2) { temp = String.valueOf (calendar.get (Calendar.YEAR)); buffer.append (temp.substring (temp.length() - 2)); } else withLeadingZeros (calendar.get (Calendar.YEAR), p.size, buffer); break; case MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MONTH); if (p.size < 3) withLeadingZeros (calendar.get (Calendar.MONTH) + 1, p.size, buffer); else if (p.size < 4) buffer.append (formatData.shortMonths[calendar.get (Calendar.MONTH)]); else buffer.append (formatData.months[calendar.get (Calendar.MONTH)]); break; case DATE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_MONTH); withLeadingZeros (calendar.get (Calendar.DATE), p.size, buffer); break; case HOUR_OF_DAY1_FIELD: // 1-24 buffer.setDefaultAttribute(DateFormat.Field.HOUR_OF_DAY1); withLeadingZeros ( ((calendar.get (Calendar.HOUR_OF_DAY) + 23) % 24) + 1, p.size, buffer); break; case HOUR_OF_DAY0_FIELD: // 0-23 buffer.setDefaultAttribute (DateFormat.Field.HOUR_OF_DAY0); withLeadingZeros (calendar.get (Calendar.HOUR_OF_DAY), p.size, buffer); break; case MINUTE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MINUTE); withLeadingZeros (calendar.get (Calendar.MINUTE), p.size, buffer); break; case SECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.SECOND); withLeadingZeros(calendar.get (Calendar.SECOND), p.size, buffer); break; case MILLISECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MILLISECOND); withLeadingZeros (calendar.get (Calendar.MILLISECOND), p.size, buffer); break; case DAY_OF_WEEK_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK); if (p.size < 4) buffer.append (formatData.shortWeekdays[calendar.get (Calendar.DAY_OF_WEEK)]); else buffer.append (formatData.weekdays[calendar.get (Calendar.DAY_OF_WEEK)]); break; case DAY_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_YEAR); withLeadingZeros (calendar.get (Calendar.DAY_OF_YEAR), p.size, buffer); break; case DAY_OF_WEEK_IN_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK_IN_MONTH); withLeadingZeros (calendar.get (Calendar.DAY_OF_WEEK_IN_MONTH), p.size, buffer); break; case WEEK_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_YEAR); withLeadingZeros (calendar.get (Calendar.WEEK_OF_YEAR), p.size, buffer); break; case WEEK_OF_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_MONTH); withLeadingZeros (calendar.get (Calendar.WEEK_OF_MONTH), p.size, buffer); break; case AM_PM_FIELD: buffer.setDefaultAttribute (DateFormat.Field.AM_PM); buffer.append (formatData.ampms[calendar.get (Calendar.AM_PM)]); break; case HOUR1_FIELD: // 1-12 buffer.setDefaultAttribute (DateFormat.Field.HOUR1); withLeadingZeros (((calendar.get (Calendar.HOUR) + 11) % 12) + 1, p.size, buffer); break; case HOUR0_FIELD: // 0-11 buffer.setDefaultAttribute (DateFormat.Field.HOUR0); withLeadingZeros (calendar.get (Calendar.HOUR), p.size, buffer); break; case TIMEZONE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.TIME_ZONE); TimeZone zone = calendar.getTimeZone(); boolean isDST = calendar.get (Calendar.DST_OFFSET) != 0; // FIXME: XXX: This should be a localized time zone. String zoneID = zone.getDisplayName (isDST, p.size > 3 ? TimeZone.LONG : TimeZone.SHORT); buffer.append (zoneID); break; default: throw new IllegalArgumentException ("Illegal pattern character " + p.field); } if (pos != null && (buffer.getDefaultAttribute() == pos.getFieldAttribute() || p.field == pos.getField())) { pos.setBeginIndex(beginIndex); pos.setEndIndex(buffer.length()); } } else { buffer.append(o.toString(), null); } } }
|
private void formatWithAttribute(Date date, FormatBuffer buffer, FieldPosition pos) { String temp; AttributedCharacterIterator.Attribute attribute; calendar.setTime(date); // go through vector, filling in fields where applicable, else toString Iterator iter = tokens.iterator(); while (iter.hasNext()) { Object o = iter.next(); if (o instanceof FieldSizePair) { FieldSizePair p = (FieldSizePair) o; int beginIndex = buffer.length(); switch (p.field) { case ERA_FIELD: buffer.append (formatData.eras[calendar.get (Calendar.ERA)], DateFormat.Field.ERA); break; case YEAR_FIELD: // If we have two digits, then we truncate. Otherwise, we // use the size of the pattern, and zero pad. buffer.setDefaultAttribute (DateFormat.Field.YEAR); if (p.size == 2) { temp = String.valueOf (calendar.get (Calendar.YEAR)); buffer.append (temp.substring (temp.length() - 2)); } else withLeadingZeros (calendar.get (Calendar.YEAR), p.size, buffer); break; case MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MONTH); if (p.size < 3) withLeadingZeros (calendar.get (Calendar.MONTH) + 1, p.size, buffer); else if (p.size < 4) buffer.append (formatData.shortMonths[calendar.get (Calendar.MONTH)]); else buffer.append (formatData.months[calendar.get (Calendar.MONTH)]); break; case DATE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_MONTH); withLeadingZeros (calendar.get (Calendar.DATE), p.size, buffer); break; case HOUR_OF_DAY1_FIELD: // 1-24 buffer.setDefaultAttribute(DateFormat.Field.HOUR_OF_DAY1); withLeadingZeros ( ((calendar.get (Calendar.HOUR_OF_DAY) + 23) % 24) + 1, p.size, buffer); break; case HOUR_OF_DAY0_FIELD: // 0-23 buffer.setDefaultAttribute (DateFormat.Field.HOUR_OF_DAY0); withLeadingZeros (calendar.get (Calendar.HOUR_OF_DAY), p.size, buffer); break; case MINUTE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MINUTE); withLeadingZeros (calendar.get (Calendar.MINUTE), p.size, buffer); break; case SECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.SECOND); withLeadingZeros(calendar.get (Calendar.SECOND), p.size, buffer); break; case MILLISECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MILLISECOND); withLeadingZeros (calendar.get (Calendar.MILLISECOND), p.size, buffer); break; case DAY_OF_WEEK_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK); if (p.size < 4) buffer.append (formatData.shortWeekdays[calendar.get (Calendar.DAY_OF_WEEK)]); else buffer.append (formatData.weekdays[calendar.get (Calendar.DAY_OF_WEEK)]); break; case DAY_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_YEAR); withLeadingZeros (calendar.get (Calendar.DAY_OF_YEAR), p.size, buffer); break; case DAY_OF_WEEK_IN_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK_IN_MONTH); withLeadingZeros (calendar.get (Calendar.DAY_OF_WEEK_IN_MONTH), p.size, buffer); break; case WEEK_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_YEAR); withLeadingZeros (calendar.get (Calendar.WEEK_OF_YEAR), p.size, buffer); break; case WEEK_OF_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_MONTH); withLeadingZeros (calendar.get (Calendar.WEEK_OF_MONTH), p.size, buffer); break; case AM_PM_FIELD: buffer.setDefaultAttribute (DateFormat.Field.AM_PM); buffer.append (formatData.ampms[calendar.get (Calendar.AM_PM)]); break; case HOUR1_FIELD: // 1-12 buffer.setDefaultAttribute (DateFormat.Field.HOUR1); withLeadingZeros (((calendar.get (Calendar.HOUR) + 11) % 12) + 1, p.size, buffer); break; case HOUR0_FIELD: // 0-11 buffer.setDefaultAttribute (DateFormat.Field.HOUR0); withLeadingZeros (calendar.get (Calendar.HOUR), p.size, buffer); break; case TIMEZONE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.TIME_ZONE); TimeZone zone = calendar.getTimeZone(); boolean isDST = calendar.get (Calendar.DST_OFFSET) != 0; // FIXME: XXX: This should be a localized time zone. String zoneID = zone.getDisplayName (isDST, p.size > 3 ? TimeZone.LONG : TimeZone.SHORT); buffer.append (zoneID); break; default: throw new IllegalArgumentException ("Illegal pattern character " + p.field); } if (pos != null && (buffer.getDefaultAttribute() == pos.getFieldAttribute() || p.field == pos.getField())) { pos.setBeginIndex(beginIndex); pos.setEndIndex(buffer.length()); } } else { buffer.append(o.toString(), null); } } }
| 11,401
|
private void formatWithAttribute(Date date, FormatBuffer buffer, FieldPosition pos) { String temp; AttributedCharacterIterator.Attribute attribute; calendar.setTime(date); // go through vector, filling in fields where applicable, else toString Iterator iter = tokens.iterator(); while (iter.hasNext()) { Object o = iter.next(); if (o instanceof FieldSizePair) { FieldSizePair p = (FieldSizePair) o; int beginIndex = buffer.length(); switch (p.field) { case ERA_FIELD: buffer.append (formatData.eras[calendar.get (Calendar.ERA)], DateFormat.Field.ERA); break; case YEAR_FIELD: // If we have two digits, then we truncate. Otherwise, we // use the size of the pattern, and zero pad. buffer.setDefaultAttribute (DateFormat.Field.YEAR); if (p.size == 2) { temp = String.valueOf (calendar.get (Calendar.YEAR)); buffer.append (temp.substring (temp.length() - 2)); } else withLeadingZeros (calendar.get (Calendar.YEAR), p.size, buffer); break; case MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MONTH); if (p.size < 3) withLeadingZeros (calendar.get (Calendar.MONTH) + 1, p.size, buffer); else if (p.size < 4) buffer.append (formatData.shortMonths[calendar.get (Calendar.MONTH)]); else buffer.append (formatData.months[calendar.get (Calendar.MONTH)]); break; case DATE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_MONTH); withLeadingZeros (calendar.get (Calendar.DATE), p.size, buffer); break; case HOUR_OF_DAY1_FIELD: // 1-24 buffer.setDefaultAttribute(DateFormat.Field.HOUR_OF_DAY1); withLeadingZeros ( ((calendar.get (Calendar.HOUR_OF_DAY) + 23) % 24) + 1, p.size, buffer); break; case HOUR_OF_DAY0_FIELD: // 0-23 buffer.setDefaultAttribute (DateFormat.Field.HOUR_OF_DAY0); withLeadingZeros (calendar.get (Calendar.HOUR_OF_DAY), p.size, buffer); break; case MINUTE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MINUTE); withLeadingZeros (calendar.get (Calendar.MINUTE), p.size, buffer); break; case SECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.SECOND); withLeadingZeros(calendar.get (Calendar.SECOND), p.size, buffer); break; case MILLISECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MILLISECOND); withLeadingZeros (calendar.get (Calendar.MILLISECOND), p.size, buffer); break; case DAY_OF_WEEK_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK); if (p.size < 4) buffer.append (formatData.shortWeekdays[calendar.get (Calendar.DAY_OF_WEEK)]); else buffer.append (formatData.weekdays[calendar.get (Calendar.DAY_OF_WEEK)]); break; case DAY_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_YEAR); withLeadingZeros (calendar.get (Calendar.DAY_OF_YEAR), p.size, buffer); break; case DAY_OF_WEEK_IN_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK_IN_MONTH); withLeadingZeros (calendar.get (Calendar.DAY_OF_WEEK_IN_MONTH), p.size, buffer); break; case WEEK_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_YEAR); withLeadingZeros (calendar.get (Calendar.WEEK_OF_YEAR), p.size, buffer); break; case WEEK_OF_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_MONTH); withLeadingZeros (calendar.get (Calendar.WEEK_OF_MONTH), p.size, buffer); break; case AM_PM_FIELD: buffer.setDefaultAttribute (DateFormat.Field.AM_PM); buffer.append (formatData.ampms[calendar.get (Calendar.AM_PM)]); break; case HOUR1_FIELD: // 1-12 buffer.setDefaultAttribute (DateFormat.Field.HOUR1); withLeadingZeros (((calendar.get (Calendar.HOUR) + 11) % 12) + 1, p.size, buffer); break; case HOUR0_FIELD: // 0-11 buffer.setDefaultAttribute (DateFormat.Field.HOUR0); withLeadingZeros (calendar.get (Calendar.HOUR), p.size, buffer); break; case TIMEZONE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.TIME_ZONE); TimeZone zone = calendar.getTimeZone(); boolean isDST = calendar.get (Calendar.DST_OFFSET) != 0; // FIXME: XXX: This should be a localized time zone. String zoneID = zone.getDisplayName (isDST, p.size > 3 ? TimeZone.LONG : TimeZone.SHORT); buffer.append (zoneID); break; default: throw new IllegalArgumentException ("Illegal pattern character " + p.field); } if (pos != null && (buffer.getDefaultAttribute() == pos.getFieldAttribute() || p.field == pos.getField())) { pos.setBeginIndex(beginIndex); pos.setEndIndex(buffer.length()); } } else { buffer.append(o.toString(), null); } } }
|
private void formatWithAttribute(Date date, FormatBuffer buffer, FieldPosition pos) { String temp; AttributedCharacterIterator.Attribute attribute; calendar.setTime(date); // go through vector, filling in fields where applicable, else toString Iterator iter = tokens.iterator(); while (iter.hasNext()) { Object o = iter.next(); if (o instanceof FieldSizePair) { FieldSizePair p = (FieldSizePair) o; int beginIndex = buffer.length(); switch (p.field) { case ERA_FIELD: buffer.append (formatData.eras[calendar.get (Calendar.ERA)], DateFormat.Field.ERA); break; case YEAR_FIELD: // If we have two digits, then we truncate. Otherwise, we // use the size of the pattern, and zero pad. buffer.setDefaultAttribute (DateFormat.Field.YEAR); if (p.size == 2) { temp = String.valueOf (calendar.get (Calendar.YEAR)); buffer.append (temp.substring (temp.length() - 2)); } else withLeadingZeros (calendar.get (Calendar.YEAR), p.size, buffer); break; case MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MONTH); if (p.size < 3) withLeadingZeros (calendar.get (Calendar.MONTH) + 1, p.size, buffer); else if (p.size < 4) buffer.append (formatData.shortMonths[calendar.get (Calendar.MONTH)]); else buffer.append (formatData.months[calendar.get (Calendar.MONTH)]); break; case DATE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_MONTH); withLeadingZeros (calendar.get (Calendar.DATE), p.size, buffer); break; case HOUR_OF_DAY1_FIELD: // 1-24 buffer.setDefaultAttribute(DateFormat.Field.HOUR_OF_DAY1); withLeadingZeros ( ((calendar.get (Calendar.HOUR_OF_DAY) + 23) % 24) + 1, p.size, buffer); break; case HOUR_OF_DAY0_FIELD: // 0-23 buffer.setDefaultAttribute (DateFormat.Field.HOUR_OF_DAY0); withLeadingZeros (calendar.get (Calendar.HOUR_OF_DAY), p.size, buffer); break; case MINUTE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MINUTE); withLeadingZeros (calendar.get (Calendar.MINUTE), p.size, buffer); break; case SECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.SECOND); withLeadingZeros(calendar.get (Calendar.SECOND), p.size, buffer); break; case MILLISECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MILLISECOND); withLeadingZeros (calendar.get (Calendar.MILLISECOND), p.size, buffer); break; case DAY_OF_WEEK_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK); if (p.size < 4) buffer.append (formatData.shortWeekdays[calendar.get (Calendar.DAY_OF_WEEK)]); else buffer.append (formatData.weekdays[calendar.get (Calendar.DAY_OF_WEEK)]); break; case DAY_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_YEAR); withLeadingZeros (calendar.get (Calendar.DAY_OF_YEAR), p.size, buffer); break; case DAY_OF_WEEK_IN_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK_IN_MONTH); withLeadingZeros (calendar.get (Calendar.DAY_OF_WEEK_IN_MONTH), p.size, buffer); break; case WEEK_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_YEAR); withLeadingZeros (calendar.get (Calendar.WEEK_OF_YEAR), p.size, buffer); break; case WEEK_OF_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_MONTH); withLeadingZeros (calendar.get (Calendar.WEEK_OF_MONTH), p.size, buffer); break; case AM_PM_FIELD: buffer.setDefaultAttribute (DateFormat.Field.AM_PM); buffer.append (formatData.ampms[calendar.get (Calendar.AM_PM)]); break; case HOUR1_FIELD: // 1-12 buffer.setDefaultAttribute (DateFormat.Field.HOUR1); withLeadingZeros (((calendar.get (Calendar.HOUR) + 11) % 12) + 1, p.size, buffer); break; case HOUR0_FIELD: // 0-11 buffer.setDefaultAttribute (DateFormat.Field.HOUR0); withLeadingZeros (calendar.get (Calendar.HOUR), p.size, buffer); break; case TIMEZONE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.TIME_ZONE); TimeZone zone = calendar.getTimeZone(); boolean isDST = calendar.get (Calendar.DST_OFFSET) != 0; // FIXME: XXX: This should be a localized time zone. String zoneID = zone.getDisplayName (isDST, p.size > 3 ? TimeZone.LONG : TimeZone.SHORT); buffer.append (zoneID); break; default: throw new IllegalArgumentException ("Illegal pattern character " + p.field); } if (pos != null && (buffer.getDefaultAttribute() == pos.getFieldAttribute() || p.field == pos.getField())) { pos.setBeginIndex(beginIndex); pos.setEndIndex(buffer.length()); } } else { buffer.append(o.toString(), null); } } }
| 11,402
|
private void formatWithAttribute(Date date, FormatBuffer buffer, FieldPosition pos) { String temp; AttributedCharacterIterator.Attribute attribute; calendar.setTime(date); // go through vector, filling in fields where applicable, else toString Iterator iter = tokens.iterator(); while (iter.hasNext()) { Object o = iter.next(); if (o instanceof FieldSizePair) { FieldSizePair p = (FieldSizePair) o; int beginIndex = buffer.length(); switch (p.field) { case ERA_FIELD: buffer.append (formatData.eras[calendar.get (Calendar.ERA)], DateFormat.Field.ERA); break; case YEAR_FIELD: // If we have two digits, then we truncate. Otherwise, we // use the size of the pattern, and zero pad. buffer.setDefaultAttribute (DateFormat.Field.YEAR); if (p.size == 2) { temp = String.valueOf (calendar.get (Calendar.YEAR)); buffer.append (temp.substring (temp.length() - 2)); } else withLeadingZeros (calendar.get (Calendar.YEAR), p.size, buffer); break; case MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MONTH); if (p.size < 3) withLeadingZeros (calendar.get (Calendar.MONTH) + 1, p.size, buffer); else if (p.size < 4) buffer.append (formatData.shortMonths[calendar.get (Calendar.MONTH)]); else buffer.append (formatData.months[calendar.get (Calendar.MONTH)]); break; case DATE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_MONTH); withLeadingZeros (calendar.get (Calendar.DATE), p.size, buffer); break; case HOUR_OF_DAY1_FIELD: // 1-24 buffer.setDefaultAttribute(DateFormat.Field.HOUR_OF_DAY1); withLeadingZeros ( ((calendar.get (Calendar.HOUR_OF_DAY) + 23) % 24) + 1, p.size, buffer); break; case HOUR_OF_DAY0_FIELD: // 0-23 buffer.setDefaultAttribute (DateFormat.Field.HOUR_OF_DAY0); withLeadingZeros (calendar.get (Calendar.HOUR_OF_DAY), p.size, buffer); break; case MINUTE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MINUTE); withLeadingZeros (calendar.get (Calendar.MINUTE), p.size, buffer); break; case SECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.SECOND); withLeadingZeros(calendar.get (Calendar.SECOND), p.size, buffer); break; case MILLISECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MILLISECOND); withLeadingZeros (calendar.get (Calendar.MILLISECOND), p.size, buffer); break; case DAY_OF_WEEK_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK); if (p.size < 4) buffer.append (formatData.shortWeekdays[calendar.get (Calendar.DAY_OF_WEEK)]); else buffer.append (formatData.weekdays[calendar.get (Calendar.DAY_OF_WEEK)]); break; case DAY_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_YEAR); withLeadingZeros (calendar.get (Calendar.DAY_OF_YEAR), p.size, buffer); break; case DAY_OF_WEEK_IN_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK_IN_MONTH); withLeadingZeros (calendar.get (Calendar.DAY_OF_WEEK_IN_MONTH), p.size, buffer); break; case WEEK_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_YEAR); withLeadingZeros (calendar.get (Calendar.WEEK_OF_YEAR), p.size, buffer); break; case WEEK_OF_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_MONTH); withLeadingZeros (calendar.get (Calendar.WEEK_OF_MONTH), p.size, buffer); break; case AM_PM_FIELD: buffer.setDefaultAttribute (DateFormat.Field.AM_PM); buffer.append (formatData.ampms[calendar.get (Calendar.AM_PM)]); break; case HOUR1_FIELD: // 1-12 buffer.setDefaultAttribute (DateFormat.Field.HOUR1); withLeadingZeros (((calendar.get (Calendar.HOUR) + 11) % 12) + 1, p.size, buffer); break; case HOUR0_FIELD: // 0-11 buffer.setDefaultAttribute (DateFormat.Field.HOUR0); withLeadingZeros (calendar.get (Calendar.HOUR), p.size, buffer); break; case TIMEZONE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.TIME_ZONE); TimeZone zone = calendar.getTimeZone(); boolean isDST = calendar.get (Calendar.DST_OFFSET) != 0; // FIXME: XXX: This should be a localized time zone. String zoneID = zone.getDisplayName (isDST, p.size > 3 ? TimeZone.LONG : TimeZone.SHORT); buffer.append (zoneID); break; default: throw new IllegalArgumentException ("Illegal pattern character " + p.field); } if (pos != null && (buffer.getDefaultAttribute() == pos.getFieldAttribute() || p.field == pos.getField())) { pos.setBeginIndex(beginIndex); pos.setEndIndex(buffer.length()); } } else { buffer.append(o.toString(), null); } } }
|
private void formatWithAttribute(Date date, FormatBuffer buffer, FieldPosition pos) { String temp; AttributedCharacterIterator.Attribute attribute; calendar.setTime(date); // go through vector, filling in fields where applicable, else toString Iterator iter = tokens.iterator(); while (iter.hasNext()) { Object o = iter.next(); if (o instanceof FieldSizePair) { FieldSizePair p = (FieldSizePair) o; int beginIndex = buffer.length(); switch (p.field) { case ERA_FIELD: buffer.append (formatData.eras[calendar.get (Calendar.ERA)], DateFormat.Field.ERA); break; case YEAR_FIELD: // If we have two digits, then we truncate. Otherwise, we // use the size of the pattern, and zero pad. buffer.setDefaultAttribute (DateFormat.Field.YEAR); if (p.size == 2) { temp = String.valueOf (calendar.get (Calendar.YEAR)); buffer.append (temp.substring (temp.length() - 2)); } else withLeadingZeros (calendar.get (Calendar.YEAR), p.size, buffer); break; case MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MONTH); if (p.size < 3) withLeadingZeros (calendar.get (Calendar.MONTH) + 1, p.size, buffer); else if (p.size < 4) buffer.append (formatData.shortMonths[calendar.get (Calendar.MONTH)]); else buffer.append (formatData.months[calendar.get (Calendar.MONTH)]); break; case DATE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_MONTH); withLeadingZeros (calendar.get (Calendar.DATE), p.size, buffer); break; case HOUR_OF_DAY1_FIELD: // 1-24 buffer.setDefaultAttribute(DateFormat.Field.HOUR_OF_DAY1); withLeadingZeros ( ((calendar.get (Calendar.HOUR_OF_DAY) + 23) % 24) + 1, p.size, buffer); break; case HOUR_OF_DAY0_FIELD: // 0-23 buffer.setDefaultAttribute (DateFormat.Field.HOUR_OF_DAY0); withLeadingZeros (calendar.get (Calendar.HOUR_OF_DAY), p.size, buffer); break; case MINUTE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MINUTE); withLeadingZeros (calendar.get (Calendar.MINUTE), p.size, buffer); break; case SECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.SECOND); withLeadingZeros(calendar.get (Calendar.SECOND), p.size, buffer); break; case MILLISECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MILLISECOND); withLeadingZeros (calendar.get (Calendar.MILLISECOND), p.size, buffer); break; case DAY_OF_WEEK_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK); if (p.size < 4) buffer.append (formatData.shortWeekdays[calendar.get (Calendar.DAY_OF_WEEK)]); else buffer.append (formatData.weekdays[calendar.get (Calendar.DAY_OF_WEEK)]); break; case DAY_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_YEAR); withLeadingZeros (calendar.get (Calendar.DAY_OF_YEAR), p.size, buffer); break; case DAY_OF_WEEK_IN_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK_IN_MONTH); withLeadingZeros (calendar.get (Calendar.DAY_OF_WEEK_IN_MONTH), p.size, buffer); break; case WEEK_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_YEAR); withLeadingZeros (calendar.get (Calendar.WEEK_OF_YEAR), p.size, buffer); break; case WEEK_OF_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_MONTH); withLeadingZeros (calendar.get (Calendar.WEEK_OF_MONTH), p.size, buffer); break; case AM_PM_FIELD: buffer.setDefaultAttribute (DateFormat.Field.AM_PM); buffer.append (formatData.ampms[calendar.get (Calendar.AM_PM)]); break; case HOUR1_FIELD: // 1-12 buffer.setDefaultAttribute (DateFormat.Field.HOUR1); withLeadingZeros (((calendar.get (Calendar.HOUR) + 11) % 12) + 1, p.size, buffer); break; case HOUR0_FIELD: // 0-11 buffer.setDefaultAttribute (DateFormat.Field.HOUR0); withLeadingZeros (calendar.get (Calendar.HOUR), p.size, buffer); break; case TIMEZONE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.TIME_ZONE); TimeZone zone = calendar.getTimeZone(); boolean isDST = calendar.get (Calendar.DST_OFFSET) != 0; // FIXME: XXX: This should be a localized time zone. String zoneID = zone.getDisplayName (isDST, p.size > 3 ? TimeZone.LONG : TimeZone.SHORT); buffer.append (zoneID); break; default: throw new IllegalArgumentException ("Illegal pattern character " + p.field); } if (pos != null && (buffer.getDefaultAttribute() == pos.getFieldAttribute() || p.field == pos.getField())) { pos.setBeginIndex(beginIndex); pos.setEndIndex(buffer.length()); } } else { buffer.append(o.toString(), null); } } }
| 11,403
|
private void formatWithAttribute(Date date, FormatBuffer buffer, FieldPosition pos) { String temp; AttributedCharacterIterator.Attribute attribute; calendar.setTime(date); // go through vector, filling in fields where applicable, else toString Iterator iter = tokens.iterator(); while (iter.hasNext()) { Object o = iter.next(); if (o instanceof FieldSizePair) { FieldSizePair p = (FieldSizePair) o; int beginIndex = buffer.length(); switch (p.field) { case ERA_FIELD: buffer.append (formatData.eras[calendar.get (Calendar.ERA)], DateFormat.Field.ERA); break; case YEAR_FIELD: // If we have two digits, then we truncate. Otherwise, we // use the size of the pattern, and zero pad. buffer.setDefaultAttribute (DateFormat.Field.YEAR); if (p.size == 2) { temp = String.valueOf (calendar.get (Calendar.YEAR)); buffer.append (temp.substring (temp.length() - 2)); } else withLeadingZeros (calendar.get (Calendar.YEAR), p.size, buffer); break; case MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MONTH); if (p.size < 3) withLeadingZeros (calendar.get (Calendar.MONTH) + 1, p.size, buffer); else if (p.size < 4) buffer.append (formatData.shortMonths[calendar.get (Calendar.MONTH)]); else buffer.append (formatData.months[calendar.get (Calendar.MONTH)]); break; case DATE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_MONTH); withLeadingZeros (calendar.get (Calendar.DATE), p.size, buffer); break; case HOUR_OF_DAY1_FIELD: // 1-24 buffer.setDefaultAttribute(DateFormat.Field.HOUR_OF_DAY1); withLeadingZeros ( ((calendar.get (Calendar.HOUR_OF_DAY) + 23) % 24) + 1, p.size, buffer); break; case HOUR_OF_DAY0_FIELD: // 0-23 buffer.setDefaultAttribute (DateFormat.Field.HOUR_OF_DAY0); withLeadingZeros (calendar.get (Calendar.HOUR_OF_DAY), p.size, buffer); break; case MINUTE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MINUTE); withLeadingZeros (calendar.get (Calendar.MINUTE), p.size, buffer); break; case SECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.SECOND); withLeadingZeros(calendar.get (Calendar.SECOND), p.size, buffer); break; case MILLISECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MILLISECOND); withLeadingZeros (calendar.get (Calendar.MILLISECOND), p.size, buffer); break; case DAY_OF_WEEK_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK); if (p.size < 4) buffer.append (formatData.shortWeekdays[calendar.get (Calendar.DAY_OF_WEEK)]); else buffer.append (formatData.weekdays[calendar.get (Calendar.DAY_OF_WEEK)]); break; case DAY_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_YEAR); withLeadingZeros (calendar.get (Calendar.DAY_OF_YEAR), p.size, buffer); break; case DAY_OF_WEEK_IN_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK_IN_MONTH); withLeadingZeros (calendar.get (Calendar.DAY_OF_WEEK_IN_MONTH), p.size, buffer); break; case WEEK_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_YEAR); withLeadingZeros (calendar.get (Calendar.WEEK_OF_YEAR), p.size, buffer); break; case WEEK_OF_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_MONTH); withLeadingZeros (calendar.get (Calendar.WEEK_OF_MONTH), p.size, buffer); break; case AM_PM_FIELD: buffer.setDefaultAttribute (DateFormat.Field.AM_PM); buffer.append (formatData.ampms[calendar.get (Calendar.AM_PM)]); break; case HOUR1_FIELD: // 1-12 buffer.setDefaultAttribute (DateFormat.Field.HOUR1); withLeadingZeros (((calendar.get (Calendar.HOUR) + 11) % 12) + 1, p.size, buffer); break; case HOUR0_FIELD: // 0-11 buffer.setDefaultAttribute (DateFormat.Field.HOUR0); withLeadingZeros (calendar.get (Calendar.HOUR), p.size, buffer); break; case TIMEZONE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.TIME_ZONE); TimeZone zone = calendar.getTimeZone(); boolean isDST = calendar.get (Calendar.DST_OFFSET) != 0; // FIXME: XXX: This should be a localized time zone. String zoneID = zone.getDisplayName (isDST, p.size > 3 ? TimeZone.LONG : TimeZone.SHORT); buffer.append (zoneID); break; default: throw new IllegalArgumentException ("Illegal pattern character " + p.field); } if (pos != null && (buffer.getDefaultAttribute() == pos.getFieldAttribute() || p.field == pos.getField())) { pos.setBeginIndex(beginIndex); pos.setEndIndex(buffer.length()); } } else { buffer.append(o.toString(), null); } } }
|
private void formatWithAttribute(Date date, FormatBuffer buffer, FieldPosition pos) { String temp; AttributedCharacterIterator.Attribute attribute; calendar.setTime(date); // go through vector, filling in fields where applicable, else toString Iterator iter = tokens.iterator(); while (iter.hasNext()) { Object o = iter.next(); if (o instanceof FieldSizePair) { FieldSizePair p = (FieldSizePair) o; int beginIndex = buffer.length(); switch (p.field) { case ERA_FIELD: buffer.append (formatData.eras[calendar.get (Calendar.ERA)], DateFormat.Field.ERA); break; case YEAR_FIELD: // If we have two digits, then we truncate. Otherwise, we // use the size of the pattern, and zero pad. buffer.setDefaultAttribute (DateFormat.Field.YEAR); if (p.size == 2) { temp = String.valueOf (calendar.get (Calendar.YEAR)); buffer.append (temp.substring (temp.length() - 2)); } else withLeadingZeros (calendar.get (Calendar.YEAR), p.size, buffer); break; case MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MONTH); if (p.size < 3) withLeadingZeros (calendar.get (Calendar.MONTH) + 1, p.size, buffer); else if (p.size < 4) buffer.append (formatData.shortMonths[calendar.get (Calendar.MONTH)]); else buffer.append (formatData.months[calendar.get (Calendar.MONTH)]); break; case DATE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_MONTH); withLeadingZeros (calendar.get (Calendar.DATE), p.size, buffer); break; case HOUR_OF_DAY1_FIELD: // 1-24 buffer.setDefaultAttribute(DateFormat.Field.HOUR_OF_DAY1); withLeadingZeros ( ((calendar.get (Calendar.HOUR_OF_DAY) + 23) % 24) + 1, p.size, buffer); break; case HOUR_OF_DAY0_FIELD: // 0-23 buffer.setDefaultAttribute (DateFormat.Field.HOUR_OF_DAY0); withLeadingZeros (calendar.get (Calendar.HOUR_OF_DAY), p.size, buffer); break; case MINUTE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MINUTE); withLeadingZeros (calendar.get (Calendar.MINUTE), p.size, buffer); break; case SECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.SECOND); withLeadingZeros(calendar.get (Calendar.SECOND), p.size, buffer); break; case MILLISECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MILLISECOND); withLeadingZeros (calendar.get (Calendar.MILLISECOND), p.size, buffer); break; case DAY_OF_WEEK_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK); if (p.size < 4) buffer.append (formatData.shortWeekdays[calendar.get (Calendar.DAY_OF_WEEK)]); else buffer.append (formatData.weekdays[calendar.get (Calendar.DAY_OF_WEEK)]); break; case DAY_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_YEAR); withLeadingZeros (calendar.get (Calendar.DAY_OF_YEAR), p.size, buffer); break; case DAY_OF_WEEK_IN_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK_IN_MONTH); withLeadingZeros (calendar.get (Calendar.DAY_OF_WEEK_IN_MONTH), p.size, buffer); break; case WEEK_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_YEAR); withLeadingZeros (calendar.get (Calendar.WEEK_OF_YEAR), p.size, buffer); break; case WEEK_OF_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_MONTH); withLeadingZeros (calendar.get (Calendar.WEEK_OF_MONTH), p.size, buffer); break; case AM_PM_FIELD: buffer.setDefaultAttribute (DateFormat.Field.AM_PM); buffer.append (formatData.ampms[calendar.get (Calendar.AM_PM)]); break; case HOUR1_FIELD: // 1-12 buffer.setDefaultAttribute (DateFormat.Field.HOUR1); withLeadingZeros (((calendar.get (Calendar.HOUR) + 11) % 12) + 1, p.size, buffer); break; case HOUR0_FIELD: // 0-11 buffer.setDefaultAttribute (DateFormat.Field.HOUR0); withLeadingZeros (calendar.get (Calendar.HOUR), p.size, buffer); break; case TIMEZONE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.TIME_ZONE); TimeZone zone = calendar.getTimeZone(); boolean isDST = calendar.get (Calendar.DST_OFFSET) != 0; // FIXME: XXX: This should be a localized time zone. String zoneID = zone.getDisplayName (isDST, p.size > 3 ? TimeZone.LONG : TimeZone.SHORT); buffer.append (zoneID); break; default: throw new IllegalArgumentException ("Illegal pattern character " + p.field); } if (pos != null && (buffer.getDefaultAttribute() == pos.getFieldAttribute() || p.field == pos.getField())) { pos.setBeginIndex(beginIndex); pos.setEndIndex(buffer.length()); } } else { buffer.append(o.toString(), null); } } }
| 11,404
|
private void formatWithAttribute(Date date, FormatBuffer buffer, FieldPosition pos) { String temp; AttributedCharacterIterator.Attribute attribute; calendar.setTime(date); // go through vector, filling in fields where applicable, else toString Iterator iter = tokens.iterator(); while (iter.hasNext()) { Object o = iter.next(); if (o instanceof FieldSizePair) { FieldSizePair p = (FieldSizePair) o; int beginIndex = buffer.length(); switch (p.field) { case ERA_FIELD: buffer.append (formatData.eras[calendar.get (Calendar.ERA)], DateFormat.Field.ERA); break; case YEAR_FIELD: // If we have two digits, then we truncate. Otherwise, we // use the size of the pattern, and zero pad. buffer.setDefaultAttribute (DateFormat.Field.YEAR); if (p.size == 2) { temp = String.valueOf (calendar.get (Calendar.YEAR)); buffer.append (temp.substring (temp.length() - 2)); } else withLeadingZeros (calendar.get (Calendar.YEAR), p.size, buffer); break; case MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MONTH); if (p.size < 3) withLeadingZeros (calendar.get (Calendar.MONTH) + 1, p.size, buffer); else if (p.size < 4) buffer.append (formatData.shortMonths[calendar.get (Calendar.MONTH)]); else buffer.append (formatData.months[calendar.get (Calendar.MONTH)]); break; case DATE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_MONTH); withLeadingZeros (calendar.get (Calendar.DATE), p.size, buffer); break; case HOUR_OF_DAY1_FIELD: // 1-24 buffer.setDefaultAttribute(DateFormat.Field.HOUR_OF_DAY1); withLeadingZeros ( ((calendar.get (Calendar.HOUR_OF_DAY) + 23) % 24) + 1, p.size, buffer); break; case HOUR_OF_DAY0_FIELD: // 0-23 buffer.setDefaultAttribute (DateFormat.Field.HOUR_OF_DAY0); withLeadingZeros (calendar.get (Calendar.HOUR_OF_DAY), p.size, buffer); break; case MINUTE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MINUTE); withLeadingZeros (calendar.get (Calendar.MINUTE), p.size, buffer); break; case SECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.SECOND); withLeadingZeros(calendar.get (Calendar.SECOND), p.size, buffer); break; case MILLISECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MILLISECOND); withLeadingZeros (calendar.get (Calendar.MILLISECOND), p.size, buffer); break; case DAY_OF_WEEK_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK); if (p.size < 4) buffer.append (formatData.shortWeekdays[calendar.get (Calendar.DAY_OF_WEEK)]); else buffer.append (formatData.weekdays[calendar.get (Calendar.DAY_OF_WEEK)]); break; case DAY_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_YEAR); withLeadingZeros (calendar.get (Calendar.DAY_OF_YEAR), p.size, buffer); break; case DAY_OF_WEEK_IN_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK_IN_MONTH); withLeadingZeros (calendar.get (Calendar.DAY_OF_WEEK_IN_MONTH), p.size, buffer); break; case WEEK_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_YEAR); withLeadingZeros (calendar.get (Calendar.WEEK_OF_YEAR), p.size, buffer); break; case WEEK_OF_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_MONTH); withLeadingZeros (calendar.get (Calendar.WEEK_OF_MONTH), p.size, buffer); break; case AM_PM_FIELD: buffer.setDefaultAttribute (DateFormat.Field.AM_PM); buffer.append (formatData.ampms[calendar.get (Calendar.AM_PM)]); break; case HOUR1_FIELD: // 1-12 buffer.setDefaultAttribute (DateFormat.Field.HOUR1); withLeadingZeros (((calendar.get (Calendar.HOUR) + 11) % 12) + 1, p.size, buffer); break; case HOUR0_FIELD: // 0-11 buffer.setDefaultAttribute (DateFormat.Field.HOUR0); withLeadingZeros (calendar.get (Calendar.HOUR), p.size, buffer); break; case TIMEZONE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.TIME_ZONE); TimeZone zone = calendar.getTimeZone(); boolean isDST = calendar.get (Calendar.DST_OFFSET) != 0; // FIXME: XXX: This should be a localized time zone. String zoneID = zone.getDisplayName (isDST, p.size > 3 ? TimeZone.LONG : TimeZone.SHORT); buffer.append (zoneID); break; default: throw new IllegalArgumentException ("Illegal pattern character " + p.field); } if (pos != null && (buffer.getDefaultAttribute() == pos.getFieldAttribute() || p.field == pos.getField())) { pos.setBeginIndex(beginIndex); pos.setEndIndex(buffer.length()); } } else { buffer.append(o.toString(), null); } } }
|
private void formatWithAttribute(Date date, FormatBuffer buffer, FieldPosition pos) { String temp; AttributedCharacterIterator.Attribute attribute; calendar.setTime(date); // go through vector, filling in fields where applicable, else toString Iterator iter = tokens.iterator(); while (iter.hasNext()) { Object o = iter.next(); if (o instanceof FieldSizePair) { FieldSizePair p = (FieldSizePair) o; int beginIndex = buffer.length(); switch (p.field) { case ERA_FIELD: buffer.append (formatData.eras[calendar.get (Calendar.ERA)], DateFormat.Field.ERA); break; case YEAR_FIELD: // If we have two digits, then we truncate. Otherwise, we // use the size of the pattern, and zero pad. buffer.setDefaultAttribute (DateFormat.Field.YEAR); if (p.size == 2) { temp = String.valueOf (calendar.get (Calendar.YEAR)); buffer.append (temp.substring (temp.length() - 2)); } else withLeadingZeros (calendar.get (Calendar.YEAR), p.size, buffer); break; case MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MONTH); if (p.size < 3) withLeadingZeros (calendar.get (Calendar.MONTH) + 1, p.size, buffer); else if (p.size < 4) buffer.append (formatData.shortMonths[calendar.get (Calendar.MONTH)]); else buffer.append (formatData.months[calendar.get (Calendar.MONTH)]); break; case DATE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_MONTH); withLeadingZeros (calendar.get (Calendar.DATE), p.size, buffer); break; case HOUR_OF_DAY1_FIELD: // 1-24 buffer.setDefaultAttribute(DateFormat.Field.HOUR_OF_DAY1); withLeadingZeros ( ((calendar.get (Calendar.HOUR_OF_DAY) + 23) % 24) + 1, p.size, buffer); break; case HOUR_OF_DAY0_FIELD: // 0-23 buffer.setDefaultAttribute (DateFormat.Field.HOUR_OF_DAY0); withLeadingZeros (calendar.get (Calendar.HOUR_OF_DAY), p.size, buffer); break; case MINUTE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MINUTE); withLeadingZeros (calendar.get (Calendar.MINUTE), p.size, buffer); break; case SECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.SECOND); withLeadingZeros(calendar.get (Calendar.SECOND), p.size, buffer); break; case MILLISECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MILLISECOND); withLeadingZeros (calendar.get (Calendar.MILLISECOND), p.size, buffer); break; case DAY_OF_WEEK_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK); if (p.size < 4) buffer.append (formatData.shortWeekdays[calendar.get (Calendar.DAY_OF_WEEK)]); else buffer.append (formatData.weekdays[calendar.get (Calendar.DAY_OF_WEEK)]); break; case DAY_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_YEAR); withLeadingZeros (calendar.get (Calendar.DAY_OF_YEAR), p.size, buffer); break; case DAY_OF_WEEK_IN_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK_IN_MONTH); withLeadingZeros (calendar.get (Calendar.DAY_OF_WEEK_IN_MONTH), p.size, buffer); break; case WEEK_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_YEAR); withLeadingZeros (calendar.get (Calendar.WEEK_OF_YEAR), p.size, buffer); break; case WEEK_OF_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_MONTH); withLeadingZeros (calendar.get (Calendar.WEEK_OF_MONTH), p.size, buffer); break; case AM_PM_FIELD: buffer.setDefaultAttribute (DateFormat.Field.AM_PM); buffer.append (formatData.ampms[calendar.get (Calendar.AM_PM)]); break; case HOUR1_FIELD: // 1-12 buffer.setDefaultAttribute (DateFormat.Field.HOUR1); withLeadingZeros (((calendar.get (Calendar.HOUR) + 11) % 12) + 1, p.size, buffer); break; case HOUR0_FIELD: // 0-11 buffer.setDefaultAttribute (DateFormat.Field.HOUR0); withLeadingZeros (calendar.get (Calendar.HOUR), p.size, buffer); break; case TIMEZONE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.TIME_ZONE); TimeZone zone = calendar.getTimeZone(); boolean isDST = calendar.get (Calendar.DST_OFFSET) != 0; // FIXME: XXX: This should be a localized time zone. String zoneID = zone.getDisplayName (isDST, p.size > 3 ? TimeZone.LONG : TimeZone.SHORT); buffer.append (zoneID); break; default: throw new IllegalArgumentException ("Illegal pattern character " + p.field); } if (pos != null && (buffer.getDefaultAttribute() == pos.getFieldAttribute() || p.field == pos.getField())) { pos.setBeginIndex(beginIndex); pos.setEndIndex(buffer.length()); } } else { buffer.append(o.toString(), null); } } }
| 11,405
|
private void formatWithAttribute(Date date, FormatBuffer buffer, FieldPosition pos) { String temp; AttributedCharacterIterator.Attribute attribute; calendar.setTime(date); // go through vector, filling in fields where applicable, else toString Iterator iter = tokens.iterator(); while (iter.hasNext()) { Object o = iter.next(); if (o instanceof FieldSizePair) { FieldSizePair p = (FieldSizePair) o; int beginIndex = buffer.length(); switch (p.field) { case ERA_FIELD: buffer.append (formatData.eras[calendar.get (Calendar.ERA)], DateFormat.Field.ERA); break; case YEAR_FIELD: // If we have two digits, then we truncate. Otherwise, we // use the size of the pattern, and zero pad. buffer.setDefaultAttribute (DateFormat.Field.YEAR); if (p.size == 2) { temp = String.valueOf (calendar.get (Calendar.YEAR)); buffer.append (temp.substring (temp.length() - 2)); } else withLeadingZeros (calendar.get (Calendar.YEAR), p.size, buffer); break; case MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MONTH); if (p.size < 3) withLeadingZeros (calendar.get (Calendar.MONTH) + 1, p.size, buffer); else if (p.size < 4) buffer.append (formatData.shortMonths[calendar.get (Calendar.MONTH)]); else buffer.append (formatData.months[calendar.get (Calendar.MONTH)]); break; case DATE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_MONTH); withLeadingZeros (calendar.get (Calendar.DATE), p.size, buffer); break; case HOUR_OF_DAY1_FIELD: // 1-24 buffer.setDefaultAttribute(DateFormat.Field.HOUR_OF_DAY1); withLeadingZeros ( ((calendar.get (Calendar.HOUR_OF_DAY) + 23) % 24) + 1, p.size, buffer); break; case HOUR_OF_DAY0_FIELD: // 0-23 buffer.setDefaultAttribute (DateFormat.Field.HOUR_OF_DAY0); withLeadingZeros (calendar.get (Calendar.HOUR_OF_DAY), p.size, buffer); break; case MINUTE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MINUTE); withLeadingZeros (calendar.get (Calendar.MINUTE), p.size, buffer); break; case SECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.SECOND); withLeadingZeros(calendar.get (Calendar.SECOND), p.size, buffer); break; case MILLISECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MILLISECOND); withLeadingZeros (calendar.get (Calendar.MILLISECOND), p.size, buffer); break; case DAY_OF_WEEK_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK); if (p.size < 4) buffer.append (formatData.shortWeekdays[calendar.get (Calendar.DAY_OF_WEEK)]); else buffer.append (formatData.weekdays[calendar.get (Calendar.DAY_OF_WEEK)]); break; case DAY_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_YEAR); withLeadingZeros (calendar.get (Calendar.DAY_OF_YEAR), p.size, buffer); break; case DAY_OF_WEEK_IN_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK_IN_MONTH); withLeadingZeros (calendar.get (Calendar.DAY_OF_WEEK_IN_MONTH), p.size, buffer); break; case WEEK_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_YEAR); withLeadingZeros (calendar.get (Calendar.WEEK_OF_YEAR), p.size, buffer); break; case WEEK_OF_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_MONTH); withLeadingZeros (calendar.get (Calendar.WEEK_OF_MONTH), p.size, buffer); break; case AM_PM_FIELD: buffer.setDefaultAttribute (DateFormat.Field.AM_PM); buffer.append (formatData.ampms[calendar.get (Calendar.AM_PM)]); break; case HOUR1_FIELD: // 1-12 buffer.setDefaultAttribute (DateFormat.Field.HOUR1); withLeadingZeros (((calendar.get (Calendar.HOUR) + 11) % 12) + 1, p.size, buffer); break; case HOUR0_FIELD: // 0-11 buffer.setDefaultAttribute (DateFormat.Field.HOUR0); withLeadingZeros (calendar.get (Calendar.HOUR), p.size, buffer); break; case TIMEZONE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.TIME_ZONE); TimeZone zone = calendar.getTimeZone(); boolean isDST = calendar.get (Calendar.DST_OFFSET) != 0; // FIXME: XXX: This should be a localized time zone. String zoneID = zone.getDisplayName (isDST, p.size > 3 ? TimeZone.LONG : TimeZone.SHORT); buffer.append (zoneID); break; default: throw new IllegalArgumentException ("Illegal pattern character " + p.field); } if (pos != null && (buffer.getDefaultAttribute() == pos.getFieldAttribute() || p.field == pos.getField())) { pos.setBeginIndex(beginIndex); pos.setEndIndex(buffer.length()); } } else { buffer.append(o.toString(), null); } } }
|
private void formatWithAttribute(Date date, FormatBuffer buffer, FieldPosition pos) { String temp; AttributedCharacterIterator.Attribute attribute; calendar.setTime(date); // go through vector, filling in fields where applicable, else toString Iterator iter = tokens.iterator(); while (iter.hasNext()) { Object o = iter.next(); if (o instanceof FieldSizePair) { FieldSizePair p = (FieldSizePair) o; int beginIndex = buffer.length(); switch (p.field) { case ERA_FIELD: buffer.append (formatData.eras[calendar.get (Calendar.ERA)], DateFormat.Field.ERA); break; case YEAR_FIELD: // If we have two digits, then we truncate. Otherwise, we // use the size of the pattern, and zero pad. buffer.setDefaultAttribute (DateFormat.Field.YEAR); if (p.size == 2) { temp = String.valueOf (calendar.get (Calendar.YEAR)); buffer.append (temp.substring (temp.length() - 2)); } else withLeadingZeros (calendar.get (Calendar.YEAR), p.size, buffer); break; case MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MONTH); if (p.size < 3) withLeadingZeros (calendar.get (Calendar.MONTH) + 1, p.size, buffer); else if (p.size < 4) buffer.append (formatData.shortMonths[calendar.get (Calendar.MONTH)]); else buffer.append (formatData.months[calendar.get (Calendar.MONTH)]); break; case DATE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_MONTH); withLeadingZeros (calendar.get (Calendar.DATE), p.size, buffer); break; case HOUR_OF_DAY1_FIELD: // 1-24 buffer.setDefaultAttribute(DateFormat.Field.HOUR_OF_DAY1); withLeadingZeros ( ((calendar.get (Calendar.HOUR_OF_DAY) + 23) % 24) + 1, p.size, buffer); break; case HOUR_OF_DAY0_FIELD: // 0-23 buffer.setDefaultAttribute (DateFormat.Field.HOUR_OF_DAY0); withLeadingZeros (calendar.get (Calendar.HOUR_OF_DAY), p.size, buffer); break; case MINUTE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MINUTE); withLeadingZeros (calendar.get (Calendar.MINUTE), p.size, buffer); break; case SECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.SECOND); withLeadingZeros(calendar.get (Calendar.SECOND), p.size, buffer); break; case MILLISECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MILLISECOND); withLeadingZeros (calendar.get (Calendar.MILLISECOND), p.size, buffer); break; case DAY_OF_WEEK_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK); if (p.size < 4) buffer.append (formatData.shortWeekdays[calendar.get (Calendar.DAY_OF_WEEK)]); else buffer.append (formatData.weekdays[calendar.get (Calendar.DAY_OF_WEEK)]); break; case DAY_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_YEAR); withLeadingZeros (calendar.get (Calendar.DAY_OF_YEAR), p.size, buffer); break; case DAY_OF_WEEK_IN_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK_IN_MONTH); withLeadingZeros (calendar.get (Calendar.DAY_OF_WEEK_IN_MONTH), p.size, buffer); break; case WEEK_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_YEAR); withLeadingZeros (calendar.get (Calendar.WEEK_OF_YEAR), p.size, buffer); break; case WEEK_OF_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_MONTH); withLeadingZeros (calendar.get (Calendar.WEEK_OF_MONTH), p.size, buffer); break; case AM_PM_FIELD: buffer.setDefaultAttribute (DateFormat.Field.AM_PM); buffer.append (formatData.ampms[calendar.get (Calendar.AM_PM)]); break; case HOUR1_FIELD: // 1-12 buffer.setDefaultAttribute (DateFormat.Field.HOUR1); withLeadingZeros (((calendar.get (Calendar.HOUR) + 11) % 12) + 1, p.size, buffer); break; case HOUR0_FIELD: // 0-11 buffer.setDefaultAttribute (DateFormat.Field.HOUR0); withLeadingZeros (calendar.get (Calendar.HOUR), p.size, buffer); break; case TIMEZONE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.TIME_ZONE); TimeZone zone = calendar.getTimeZone(); boolean isDST = calendar.get (Calendar.DST_OFFSET) != 0; // FIXME: XXX: This should be a localized time zone. String zoneID = zone.getDisplayName (isDST, p.size > 3 ? TimeZone.LONG : TimeZone.SHORT); buffer.append (zoneID); break; default: throw new IllegalArgumentException ("Illegal pattern character " + p.field); } if (pos != null && (buffer.getDefaultAttribute() == pos.getFieldAttribute() || p.field == pos.getField())) { pos.setBeginIndex(beginIndex); pos.setEndIndex(buffer.length()); } } else { buffer.append(o.toString(), null); } } }
| 11,406
|
private void formatWithAttribute(Date date, FormatBuffer buffer, FieldPosition pos) { String temp; AttributedCharacterIterator.Attribute attribute; calendar.setTime(date); // go through vector, filling in fields where applicable, else toString Iterator iter = tokens.iterator(); while (iter.hasNext()) { Object o = iter.next(); if (o instanceof FieldSizePair) { FieldSizePair p = (FieldSizePair) o; int beginIndex = buffer.length(); switch (p.field) { case ERA_FIELD: buffer.append (formatData.eras[calendar.get (Calendar.ERA)], DateFormat.Field.ERA); break; case YEAR_FIELD: // If we have two digits, then we truncate. Otherwise, we // use the size of the pattern, and zero pad. buffer.setDefaultAttribute (DateFormat.Field.YEAR); if (p.size == 2) { temp = String.valueOf (calendar.get (Calendar.YEAR)); buffer.append (temp.substring (temp.length() - 2)); } else withLeadingZeros (calendar.get (Calendar.YEAR), p.size, buffer); break; case MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MONTH); if (p.size < 3) withLeadingZeros (calendar.get (Calendar.MONTH) + 1, p.size, buffer); else if (p.size < 4) buffer.append (formatData.shortMonths[calendar.get (Calendar.MONTH)]); else buffer.append (formatData.months[calendar.get (Calendar.MONTH)]); break; case DATE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_MONTH); withLeadingZeros (calendar.get (Calendar.DATE), p.size, buffer); break; case HOUR_OF_DAY1_FIELD: // 1-24 buffer.setDefaultAttribute(DateFormat.Field.HOUR_OF_DAY1); withLeadingZeros ( ((calendar.get (Calendar.HOUR_OF_DAY) + 23) % 24) + 1, p.size, buffer); break; case HOUR_OF_DAY0_FIELD: // 0-23 buffer.setDefaultAttribute (DateFormat.Field.HOUR_OF_DAY0); withLeadingZeros (calendar.get (Calendar.HOUR_OF_DAY), p.size, buffer); break; case MINUTE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MINUTE); withLeadingZeros (calendar.get (Calendar.MINUTE), p.size, buffer); break; case SECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.SECOND); withLeadingZeros(calendar.get (Calendar.SECOND), p.size, buffer); break; case MILLISECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MILLISECOND); withLeadingZeros (calendar.get (Calendar.MILLISECOND), p.size, buffer); break; case DAY_OF_WEEK_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK); if (p.size < 4) buffer.append (formatData.shortWeekdays[calendar.get (Calendar.DAY_OF_WEEK)]); else buffer.append (formatData.weekdays[calendar.get (Calendar.DAY_OF_WEEK)]); break; case DAY_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_YEAR); withLeadingZeros (calendar.get (Calendar.DAY_OF_YEAR), p.size, buffer); break; case DAY_OF_WEEK_IN_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK_IN_MONTH); withLeadingZeros (calendar.get (Calendar.DAY_OF_WEEK_IN_MONTH), p.size, buffer); break; case WEEK_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_YEAR); withLeadingZeros (calendar.get (Calendar.WEEK_OF_YEAR), p.size, buffer); break; case WEEK_OF_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_MONTH); withLeadingZeros (calendar.get (Calendar.WEEK_OF_MONTH), p.size, buffer); break; case AM_PM_FIELD: buffer.setDefaultAttribute (DateFormat.Field.AM_PM); buffer.append (formatData.ampms[calendar.get (Calendar.AM_PM)]); break; case HOUR1_FIELD: // 1-12 buffer.setDefaultAttribute (DateFormat.Field.HOUR1); withLeadingZeros (((calendar.get (Calendar.HOUR) + 11) % 12) + 1, p.size, buffer); break; case HOUR0_FIELD: // 0-11 buffer.setDefaultAttribute (DateFormat.Field.HOUR0); withLeadingZeros (calendar.get (Calendar.HOUR), p.size, buffer); break; case TIMEZONE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.TIME_ZONE); TimeZone zone = calendar.getTimeZone(); boolean isDST = calendar.get (Calendar.DST_OFFSET) != 0; // FIXME: XXX: This should be a localized time zone. String zoneID = zone.getDisplayName (isDST, p.size > 3 ? TimeZone.LONG : TimeZone.SHORT); buffer.append (zoneID); break; default: throw new IllegalArgumentException ("Illegal pattern character " + p.field); } if (pos != null && (buffer.getDefaultAttribute() == pos.getFieldAttribute() || p.field == pos.getField())) { pos.setBeginIndex(beginIndex); pos.setEndIndex(buffer.length()); } } else { buffer.append(o.toString(), null); } } }
|
private void formatWithAttribute(Date date, FormatBuffer buffer, FieldPosition pos) { String temp; AttributedCharacterIterator.Attribute attribute; calendar.setTime(date); // go through vector, filling in fields where applicable, else toString Iterator iter = tokens.iterator(); while (iter.hasNext()) { Object o = iter.next(); if (o instanceof FieldSizePair) { FieldSizePair p = (FieldSizePair) o; int beginIndex = buffer.length(); switch (p.field) { case ERA_FIELD: buffer.append (formatData.eras[calendar.get (Calendar.ERA)], DateFormat.Field.ERA); break; case YEAR_FIELD: // If we have two digits, then we truncate. Otherwise, we // use the size of the pattern, and zero pad. buffer.setDefaultAttribute (DateFormat.Field.YEAR); if (p.size == 2) { temp = String.valueOf (calendar.get (Calendar.YEAR)); buffer.append (temp.substring (temp.length() - 2)); } else withLeadingZeros (calendar.get (Calendar.YEAR), p.size, buffer); break; case MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MONTH); if (p.size < 3) withLeadingZeros (calendar.get (Calendar.MONTH) + 1, p.size, buffer); else if (p.size < 4) buffer.append (formatData.shortMonths[calendar.get (Calendar.MONTH)]); else buffer.append (formatData.months[calendar.get (Calendar.MONTH)]); break; case DATE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_MONTH); withLeadingZeros (calendar.get (Calendar.DATE), p.size, buffer); break; case HOUR_OF_DAY1_FIELD: // 1-24 buffer.setDefaultAttribute(DateFormat.Field.HOUR_OF_DAY1); withLeadingZeros ( ((calendar.get (Calendar.HOUR_OF_DAY) + 23) % 24) + 1, p.size, buffer); break; case HOUR_OF_DAY0_FIELD: // 0-23 buffer.setDefaultAttribute (DateFormat.Field.HOUR_OF_DAY0); withLeadingZeros (calendar.get (Calendar.HOUR_OF_DAY), p.size, buffer); break; case MINUTE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MINUTE); withLeadingZeros (calendar.get (Calendar.MINUTE), p.size, buffer); break; case SECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.SECOND); withLeadingZeros(calendar.get (Calendar.SECOND), p.size, buffer); break; case MILLISECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MILLISECOND); withLeadingZeros (calendar.get (Calendar.MILLISECOND), p.size, buffer); break; case DAY_OF_WEEK_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK); if (p.size < 4) buffer.append (formatData.shortWeekdays[calendar.get (Calendar.DAY_OF_WEEK)]); else buffer.append (formatData.weekdays[calendar.get (Calendar.DAY_OF_WEEK)]); break; case DAY_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_YEAR); withLeadingZeros (calendar.get (Calendar.DAY_OF_YEAR), p.size, buffer); break; case DAY_OF_WEEK_IN_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK_IN_MONTH); withLeadingZeros (calendar.get (Calendar.DAY_OF_WEEK_IN_MONTH), p.size, buffer); break; case WEEK_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_YEAR); withLeadingZeros (calendar.get (Calendar.WEEK_OF_YEAR), p.size, buffer); break; case WEEK_OF_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_MONTH); withLeadingZeros (calendar.get (Calendar.WEEK_OF_MONTH), p.size, buffer); break; case AM_PM_FIELD: buffer.setDefaultAttribute (DateFormat.Field.AM_PM); buffer.append (formatData.ampms[calendar.get (Calendar.AM_PM)]); break; case HOUR1_FIELD: // 1-12 buffer.setDefaultAttribute (DateFormat.Field.HOUR1); withLeadingZeros (((calendar.get (Calendar.HOUR) + 11) % 12) + 1, p.size, buffer); break; case HOUR0_FIELD: // 0-11 buffer.setDefaultAttribute (DateFormat.Field.HOUR0); withLeadingZeros (calendar.get (Calendar.HOUR), p.size, buffer); break; case TIMEZONE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.TIME_ZONE); TimeZone zone = calendar.getTimeZone(); boolean isDST = calendar.get (Calendar.DST_OFFSET) != 0; // FIXME: XXX: This should be a localized time zone. String zoneID = zone.getDisplayName (isDST, p.size > 3 ? TimeZone.LONG : TimeZone.SHORT); buffer.append (zoneID); break; default: throw new IllegalArgumentException ("Illegal pattern character " + p.field); } if (pos != null && (buffer.getDefaultAttribute() == pos.getFieldAttribute() || p.field == pos.getField())) { pos.setBeginIndex(beginIndex); pos.setEndIndex(buffer.length()); } } else { buffer.append(o.toString(), null); } } }
| 11,407
|
private void formatWithAttribute(Date date, FormatBuffer buffer, FieldPosition pos) { String temp; AttributedCharacterIterator.Attribute attribute; calendar.setTime(date); // go through vector, filling in fields where applicable, else toString Iterator iter = tokens.iterator(); while (iter.hasNext()) { Object o = iter.next(); if (o instanceof FieldSizePair) { FieldSizePair p = (FieldSizePair) o; int beginIndex = buffer.length(); switch (p.field) { case ERA_FIELD: buffer.append (formatData.eras[calendar.get (Calendar.ERA)], DateFormat.Field.ERA); break; case YEAR_FIELD: // If we have two digits, then we truncate. Otherwise, we // use the size of the pattern, and zero pad. buffer.setDefaultAttribute (DateFormat.Field.YEAR); if (p.size == 2) { temp = String.valueOf (calendar.get (Calendar.YEAR)); buffer.append (temp.substring (temp.length() - 2)); } else withLeadingZeros (calendar.get (Calendar.YEAR), p.size, buffer); break; case MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MONTH); if (p.size < 3) withLeadingZeros (calendar.get (Calendar.MONTH) + 1, p.size, buffer); else if (p.size < 4) buffer.append (formatData.shortMonths[calendar.get (Calendar.MONTH)]); else buffer.append (formatData.months[calendar.get (Calendar.MONTH)]); break; case DATE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_MONTH); withLeadingZeros (calendar.get (Calendar.DATE), p.size, buffer); break; case HOUR_OF_DAY1_FIELD: // 1-24 buffer.setDefaultAttribute(DateFormat.Field.HOUR_OF_DAY1); withLeadingZeros ( ((calendar.get (Calendar.HOUR_OF_DAY) + 23) % 24) + 1, p.size, buffer); break; case HOUR_OF_DAY0_FIELD: // 0-23 buffer.setDefaultAttribute (DateFormat.Field.HOUR_OF_DAY0); withLeadingZeros (calendar.get (Calendar.HOUR_OF_DAY), p.size, buffer); break; case MINUTE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MINUTE); withLeadingZeros (calendar.get (Calendar.MINUTE), p.size, buffer); break; case SECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.SECOND); withLeadingZeros(calendar.get (Calendar.SECOND), p.size, buffer); break; case MILLISECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MILLISECOND); withLeadingZeros (calendar.get (Calendar.MILLISECOND), p.size, buffer); break; case DAY_OF_WEEK_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK); if (p.size < 4) buffer.append (formatData.shortWeekdays[calendar.get (Calendar.DAY_OF_WEEK)]); else buffer.append (formatData.weekdays[calendar.get (Calendar.DAY_OF_WEEK)]); break; case DAY_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_YEAR); withLeadingZeros (calendar.get (Calendar.DAY_OF_YEAR), p.size, buffer); break; case DAY_OF_WEEK_IN_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK_IN_MONTH); withLeadingZeros (calendar.get (Calendar.DAY_OF_WEEK_IN_MONTH), p.size, buffer); break; case WEEK_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_YEAR); withLeadingZeros (calendar.get (Calendar.WEEK_OF_YEAR), p.size, buffer); break; case WEEK_OF_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_MONTH); withLeadingZeros (calendar.get (Calendar.WEEK_OF_MONTH), p.size, buffer); break; case AM_PM_FIELD: buffer.setDefaultAttribute (DateFormat.Field.AM_PM); buffer.append (formatData.ampms[calendar.get (Calendar.AM_PM)]); break; case HOUR1_FIELD: // 1-12 buffer.setDefaultAttribute (DateFormat.Field.HOUR1); withLeadingZeros (((calendar.get (Calendar.HOUR) + 11) % 12) + 1, p.size, buffer); break; case HOUR0_FIELD: // 0-11 buffer.setDefaultAttribute (DateFormat.Field.HOUR0); withLeadingZeros (calendar.get (Calendar.HOUR), p.size, buffer); break; case TIMEZONE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.TIME_ZONE); TimeZone zone = calendar.getTimeZone(); boolean isDST = calendar.get (Calendar.DST_OFFSET) != 0; // FIXME: XXX: This should be a localized time zone. String zoneID = zone.getDisplayName (isDST, p.size > 3 ? TimeZone.LONG : TimeZone.SHORT); buffer.append (zoneID); break; default: throw new IllegalArgumentException ("Illegal pattern character " + p.field); } if (pos != null && (buffer.getDefaultAttribute() == pos.getFieldAttribute() || p.field == pos.getField())) { pos.setBeginIndex(beginIndex); pos.setEndIndex(buffer.length()); } } else { buffer.append(o.toString(), null); } } }
|
private void formatWithAttribute(Date date, FormatBuffer buffer, FieldPosition pos) { String temp; AttributedCharacterIterator.Attribute attribute; calendar.setTime(date); // go through vector, filling in fields where applicable, else toString Iterator iter = tokens.iterator(); while (iter.hasNext()) { Object o = iter.next(); if (o instanceof FieldSizePair) { FieldSizePair p = (FieldSizePair) o; int beginIndex = buffer.length(); switch (p.field) { case ERA_FIELD: buffer.append (formatData.eras[calendar.get (Calendar.ERA)], DateFormat.Field.ERA); break; case YEAR_FIELD: // If we have two digits, then we truncate. Otherwise, we // use the size of the pattern, and zero pad. buffer.setDefaultAttribute (DateFormat.Field.YEAR); if (p.size == 2) { temp = String.valueOf (calendar.get (Calendar.YEAR)); buffer.append (temp.substring (temp.length() - 2)); } else withLeadingZeros (calendar.get (Calendar.YEAR), p.size, buffer); break; case MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MONTH); if (p.size < 3) withLeadingZeros (calendar.get (Calendar.MONTH) + 1, p.size, buffer); else if (p.size < 4) buffer.append (formatData.shortMonths[calendar.get (Calendar.MONTH)]); else buffer.append (formatData.months[calendar.get (Calendar.MONTH)]); break; case DATE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_MONTH); withLeadingZeros (calendar.get (Calendar.DATE), p.size, buffer); break; case HOUR_OF_DAY1_FIELD: // 1-24 buffer.setDefaultAttribute(DateFormat.Field.HOUR_OF_DAY1); withLeadingZeros ( ((calendar.get (Calendar.HOUR_OF_DAY) + 23) % 24) + 1, p.size, buffer); break; case HOUR_OF_DAY0_FIELD: // 0-23 buffer.setDefaultAttribute (DateFormat.Field.HOUR_OF_DAY0); withLeadingZeros (calendar.get (Calendar.HOUR_OF_DAY), p.size, buffer); break; case MINUTE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MINUTE); withLeadingZeros (calendar.get (Calendar.MINUTE), p.size, buffer); break; case SECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.SECOND); withLeadingZeros(calendar.get (Calendar.SECOND), p.size, buffer); break; case MILLISECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MILLISECOND); withLeadingZeros (calendar.get (Calendar.MILLISECOND), p.size, buffer); break; case DAY_OF_WEEK_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK); if (p.size < 4) buffer.append (formatData.shortWeekdays[calendar.get (Calendar.DAY_OF_WEEK)]); else buffer.append (formatData.weekdays[calendar.get (Calendar.DAY_OF_WEEK)]); break; case DAY_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_YEAR); withLeadingZeros (calendar.get (Calendar.DAY_OF_YEAR), p.size, buffer); break; case DAY_OF_WEEK_IN_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK_IN_MONTH); withLeadingZeros (calendar.get (Calendar.DAY_OF_WEEK_IN_MONTH), p.size, buffer); break; case WEEK_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_YEAR); withLeadingZeros (calendar.get (Calendar.WEEK_OF_YEAR), p.size, buffer); break; case WEEK_OF_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_MONTH); withLeadingZeros (calendar.get (Calendar.WEEK_OF_MONTH), p.size, buffer); break; case AM_PM_FIELD: buffer.setDefaultAttribute (DateFormat.Field.AM_PM); buffer.append (formatData.ampms[calendar.get (Calendar.AM_PM)]); break; case HOUR1_FIELD: // 1-12 buffer.setDefaultAttribute (DateFormat.Field.HOUR1); withLeadingZeros (((calendar.get (Calendar.HOUR) + 11) % 12) + 1, p.size, buffer); break; case HOUR0_FIELD: // 0-11 buffer.setDefaultAttribute (DateFormat.Field.HOUR0); withLeadingZeros (calendar.get (Calendar.HOUR), p.size, buffer); break; case TIMEZONE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.TIME_ZONE); TimeZone zone = calendar.getTimeZone(); boolean isDST = calendar.get (Calendar.DST_OFFSET) != 0; // FIXME: XXX: This should be a localized time zone. String zoneID = zone.getDisplayName (isDST, p.size > 3 ? TimeZone.LONG : TimeZone.SHORT); buffer.append (zoneID); break; default: throw new IllegalArgumentException ("Illegal pattern character " + p.field); } if (pos != null && (buffer.getDefaultAttribute() == pos.getFieldAttribute() || p.field == pos.getField())) { pos.setBeginIndex(beginIndex); pos.setEndIndex(buffer.length()); } } else { buffer.append(o.toString(), null); } } }
| 11,408
|
private void formatWithAttribute(Date date, FormatBuffer buffer, FieldPosition pos) { String temp; AttributedCharacterIterator.Attribute attribute; calendar.setTime(date); // go through vector, filling in fields where applicable, else toString Iterator iter = tokens.iterator(); while (iter.hasNext()) { Object o = iter.next(); if (o instanceof FieldSizePair) { FieldSizePair p = (FieldSizePair) o; int beginIndex = buffer.length(); switch (p.field) { case ERA_FIELD: buffer.append (formatData.eras[calendar.get (Calendar.ERA)], DateFormat.Field.ERA); break; case YEAR_FIELD: // If we have two digits, then we truncate. Otherwise, we // use the size of the pattern, and zero pad. buffer.setDefaultAttribute (DateFormat.Field.YEAR); if (p.size == 2) { temp = String.valueOf (calendar.get (Calendar.YEAR)); buffer.append (temp.substring (temp.length() - 2)); } else withLeadingZeros (calendar.get (Calendar.YEAR), p.size, buffer); break; case MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MONTH); if (p.size < 3) withLeadingZeros (calendar.get (Calendar.MONTH) + 1, p.size, buffer); else if (p.size < 4) buffer.append (formatData.shortMonths[calendar.get (Calendar.MONTH)]); else buffer.append (formatData.months[calendar.get (Calendar.MONTH)]); break; case DATE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_MONTH); withLeadingZeros (calendar.get (Calendar.DATE), p.size, buffer); break; case HOUR_OF_DAY1_FIELD: // 1-24 buffer.setDefaultAttribute(DateFormat.Field.HOUR_OF_DAY1); withLeadingZeros ( ((calendar.get (Calendar.HOUR_OF_DAY) + 23) % 24) + 1, p.size, buffer); break; case HOUR_OF_DAY0_FIELD: // 0-23 buffer.setDefaultAttribute (DateFormat.Field.HOUR_OF_DAY0); withLeadingZeros (calendar.get (Calendar.HOUR_OF_DAY), p.size, buffer); break; case MINUTE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MINUTE); withLeadingZeros (calendar.get (Calendar.MINUTE), p.size, buffer); break; case SECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.SECOND); withLeadingZeros(calendar.get (Calendar.SECOND), p.size, buffer); break; case MILLISECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MILLISECOND); withLeadingZeros (calendar.get (Calendar.MILLISECOND), p.size, buffer); break; case DAY_OF_WEEK_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK); if (p.size < 4) buffer.append (formatData.shortWeekdays[calendar.get (Calendar.DAY_OF_WEEK)]); else buffer.append (formatData.weekdays[calendar.get (Calendar.DAY_OF_WEEK)]); break; case DAY_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_YEAR); withLeadingZeros (calendar.get (Calendar.DAY_OF_YEAR), p.size, buffer); break; case DAY_OF_WEEK_IN_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK_IN_MONTH); withLeadingZeros (calendar.get (Calendar.DAY_OF_WEEK_IN_MONTH), p.size, buffer); break; case WEEK_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_YEAR); withLeadingZeros (calendar.get (Calendar.WEEK_OF_YEAR), p.size, buffer); break; case WEEK_OF_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_MONTH); withLeadingZeros (calendar.get (Calendar.WEEK_OF_MONTH), p.size, buffer); break; case AM_PM_FIELD: buffer.setDefaultAttribute (DateFormat.Field.AM_PM); buffer.append (formatData.ampms[calendar.get (Calendar.AM_PM)]); break; case HOUR1_FIELD: // 1-12 buffer.setDefaultAttribute (DateFormat.Field.HOUR1); withLeadingZeros (((calendar.get (Calendar.HOUR) + 11) % 12) + 1, p.size, buffer); break; case HOUR0_FIELD: // 0-11 buffer.setDefaultAttribute (DateFormat.Field.HOUR0); withLeadingZeros (calendar.get (Calendar.HOUR), p.size, buffer); break; case TIMEZONE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.TIME_ZONE); TimeZone zone = calendar.getTimeZone(); boolean isDST = calendar.get (Calendar.DST_OFFSET) != 0; // FIXME: XXX: This should be a localized time zone. String zoneID = zone.getDisplayName (isDST, p.size > 3 ? TimeZone.LONG : TimeZone.SHORT); buffer.append (zoneID); break; default: throw new IllegalArgumentException ("Illegal pattern character " + p.field); } if (pos != null && (buffer.getDefaultAttribute() == pos.getFieldAttribute() || p.field == pos.getField())) { pos.setBeginIndex(beginIndex); pos.setEndIndex(buffer.length()); } } else { buffer.append(o.toString(), null); } } }
|
private void formatWithAttribute(Date date, FormatBuffer buffer, FieldPosition pos) { String temp; AttributedCharacterIterator.Attribute attribute; calendar.setTime(date); // go through vector, filling in fields where applicable, else toString Iterator iter = tokens.iterator(); while (iter.hasNext()) { Object o = iter.next(); if (o instanceof FieldSizePair) { FieldSizePair p = (FieldSizePair) o; int beginIndex = buffer.length(); switch (p.field) { case ERA_FIELD: buffer.append (formatData.eras[calendar.get (Calendar.ERA)], DateFormat.Field.ERA); break; case YEAR_FIELD: // If we have two digits, then we truncate. Otherwise, we // use the size of the pattern, and zero pad. buffer.setDefaultAttribute (DateFormat.Field.YEAR); if (p.size == 2) { temp = String.valueOf (calendar.get (Calendar.YEAR)); buffer.append (temp.substring (temp.length() - 2)); } else withLeadingZeros (calendar.get (Calendar.YEAR), p.size, buffer); break; case MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MONTH); if (p.size < 3) withLeadingZeros (calendar.get (Calendar.MONTH) + 1, p.size, buffer); else if (p.size < 4) buffer.append (formatData.shortMonths[calendar.get (Calendar.MONTH)]); else buffer.append (formatData.months[calendar.get (Calendar.MONTH)]); break; case DATE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_MONTH); withLeadingZeros (calendar.get (Calendar.DATE), p.size, buffer); break; case HOUR_OF_DAY1_FIELD: // 1-24 buffer.setDefaultAttribute(DateFormat.Field.HOUR_OF_DAY1); withLeadingZeros ( ((calendar.get (Calendar.HOUR_OF_DAY) + 23) % 24) + 1, p.size, buffer); break; case HOUR_OF_DAY0_FIELD: // 0-23 buffer.setDefaultAttribute (DateFormat.Field.HOUR_OF_DAY0); withLeadingZeros (calendar.get (Calendar.HOUR_OF_DAY), p.size, buffer); break; case MINUTE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MINUTE); withLeadingZeros (calendar.get (Calendar.MINUTE), p.size, buffer); break; case SECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.SECOND); withLeadingZeros(calendar.get (Calendar.SECOND), p.size, buffer); break; case MILLISECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MILLISECOND); withLeadingZeros (calendar.get (Calendar.MILLISECOND), p.size, buffer); break; case DAY_OF_WEEK_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK); if (p.size < 4) buffer.append (formatData.shortWeekdays[calendar.get (Calendar.DAY_OF_WEEK)]); else buffer.append (formatData.weekdays[calendar.get (Calendar.DAY_OF_WEEK)]); break; case DAY_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_YEAR); withLeadingZeros (calendar.get (Calendar.DAY_OF_YEAR), p.size, buffer); break; case DAY_OF_WEEK_IN_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK_IN_MONTH); withLeadingZeros (calendar.get (Calendar.DAY_OF_WEEK_IN_MONTH), p.size, buffer); break; case WEEK_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_YEAR); withLeadingZeros (calendar.get (Calendar.WEEK_OF_YEAR), p.size, buffer); break; case WEEK_OF_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_MONTH); withLeadingZeros (calendar.get (Calendar.WEEK_OF_MONTH), p.size, buffer); break; case AM_PM_FIELD: buffer.setDefaultAttribute (DateFormat.Field.AM_PM); buffer.append (formatData.ampms[calendar.get (Calendar.AM_PM)]); break; case HOUR1_FIELD: // 1-12 buffer.setDefaultAttribute (DateFormat.Field.HOUR1); withLeadingZeros (((calendar.get (Calendar.HOUR) + 11) % 12) + 1, p.size, buffer); break; case HOUR0_FIELD: // 0-11 buffer.setDefaultAttribute (DateFormat.Field.HOUR0); withLeadingZeros (calendar.get (Calendar.HOUR), p.size, buffer); break; case TIMEZONE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.TIME_ZONE); TimeZone zone = calendar.getTimeZone(); boolean isDST = calendar.get (Calendar.DST_OFFSET) != 0; // FIXME: XXX: This should be a localized time zone. String zoneID = zone.getDisplayName (isDST, p.size > 3 ? TimeZone.LONG : TimeZone.SHORT); buffer.append (zoneID); break; default: throw new IllegalArgumentException ("Illegal pattern character " + p.field); } if (pos != null && (buffer.getDefaultAttribute() == pos.getFieldAttribute() || p.field == pos.getField())) { pos.setBeginIndex(beginIndex); pos.setEndIndex(buffer.length()); } } else { buffer.append(o.toString(), null); } } }
| 11,409
|
private void formatWithAttribute(Date date, FormatBuffer buffer, FieldPosition pos) { String temp; AttributedCharacterIterator.Attribute attribute; calendar.setTime(date); // go through vector, filling in fields where applicable, else toString Iterator iter = tokens.iterator(); while (iter.hasNext()) { Object o = iter.next(); if (o instanceof FieldSizePair) { FieldSizePair p = (FieldSizePair) o; int beginIndex = buffer.length(); switch (p.field) { case ERA_FIELD: buffer.append (formatData.eras[calendar.get (Calendar.ERA)], DateFormat.Field.ERA); break; case YEAR_FIELD: // If we have two digits, then we truncate. Otherwise, we // use the size of the pattern, and zero pad. buffer.setDefaultAttribute (DateFormat.Field.YEAR); if (p.size == 2) { temp = String.valueOf (calendar.get (Calendar.YEAR)); buffer.append (temp.substring (temp.length() - 2)); } else withLeadingZeros (calendar.get (Calendar.YEAR), p.size, buffer); break; case MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MONTH); if (p.size < 3) withLeadingZeros (calendar.get (Calendar.MONTH) + 1, p.size, buffer); else if (p.size < 4) buffer.append (formatData.shortMonths[calendar.get (Calendar.MONTH)]); else buffer.append (formatData.months[calendar.get (Calendar.MONTH)]); break; case DATE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_MONTH); withLeadingZeros (calendar.get (Calendar.DATE), p.size, buffer); break; case HOUR_OF_DAY1_FIELD: // 1-24 buffer.setDefaultAttribute(DateFormat.Field.HOUR_OF_DAY1); withLeadingZeros ( ((calendar.get (Calendar.HOUR_OF_DAY) + 23) % 24) + 1, p.size, buffer); break; case HOUR_OF_DAY0_FIELD: // 0-23 buffer.setDefaultAttribute (DateFormat.Field.HOUR_OF_DAY0); withLeadingZeros (calendar.get (Calendar.HOUR_OF_DAY), p.size, buffer); break; case MINUTE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MINUTE); withLeadingZeros (calendar.get (Calendar.MINUTE), p.size, buffer); break; case SECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.SECOND); withLeadingZeros(calendar.get (Calendar.SECOND), p.size, buffer); break; case MILLISECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MILLISECOND); withLeadingZeros (calendar.get (Calendar.MILLISECOND), p.size, buffer); break; case DAY_OF_WEEK_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK); if (p.size < 4) buffer.append (formatData.shortWeekdays[calendar.get (Calendar.DAY_OF_WEEK)]); else buffer.append (formatData.weekdays[calendar.get (Calendar.DAY_OF_WEEK)]); break; case DAY_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_YEAR); withLeadingZeros (calendar.get (Calendar.DAY_OF_YEAR), p.size, buffer); break; case DAY_OF_WEEK_IN_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK_IN_MONTH); withLeadingZeros (calendar.get (Calendar.DAY_OF_WEEK_IN_MONTH), p.size, buffer); break; case WEEK_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_YEAR); withLeadingZeros (calendar.get (Calendar.WEEK_OF_YEAR), p.size, buffer); break; case WEEK_OF_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_MONTH); withLeadingZeros (calendar.get (Calendar.WEEK_OF_MONTH), p.size, buffer); break; case AM_PM_FIELD: buffer.setDefaultAttribute (DateFormat.Field.AM_PM); buffer.append (formatData.ampms[calendar.get (Calendar.AM_PM)]); break; case HOUR1_FIELD: // 1-12 buffer.setDefaultAttribute (DateFormat.Field.HOUR1); withLeadingZeros (((calendar.get (Calendar.HOUR) + 11) % 12) + 1, p.size, buffer); break; case HOUR0_FIELD: // 0-11 buffer.setDefaultAttribute (DateFormat.Field.HOUR0); withLeadingZeros (calendar.get (Calendar.HOUR), p.size, buffer); break; case TIMEZONE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.TIME_ZONE); TimeZone zone = calendar.getTimeZone(); boolean isDST = calendar.get (Calendar.DST_OFFSET) != 0; // FIXME: XXX: This should be a localized time zone. String zoneID = zone.getDisplayName (isDST, p.size > 3 ? TimeZone.LONG : TimeZone.SHORT); buffer.append (zoneID); break; default: throw new IllegalArgumentException ("Illegal pattern character " + p.field); } if (pos != null && (buffer.getDefaultAttribute() == pos.getFieldAttribute() || p.field == pos.getField())) { pos.setBeginIndex(beginIndex); pos.setEndIndex(buffer.length()); } } else { buffer.append(o.toString(), null); } } }
|
private void formatWithAttribute(Date date, FormatBuffer buffer, FieldPosition pos) { String temp; AttributedCharacterIterator.Attribute attribute; calendar.setTime(date); // go through vector, filling in fields where applicable, else toString Iterator iter = tokens.iterator(); while (iter.hasNext()) { Object o = iter.next(); if (o instanceof FieldSizePair) { FieldSizePair p = (FieldSizePair) o; int beginIndex = buffer.length(); switch (p.field) { case ERA_FIELD: buffer.append (formatData.eras[calendar.get (Calendar.ERA)], DateFormat.Field.ERA); break; case YEAR_FIELD: // If we have two digits, then we truncate. Otherwise, we // use the size of the pattern, and zero pad. buffer.setDefaultAttribute (DateFormat.Field.YEAR); if (p.size == 2) { temp = String.valueOf (calendar.get (Calendar.YEAR)); buffer.append (temp.substring (temp.length() - 2)); } else withLeadingZeros (calendar.get (Calendar.YEAR), p.size, buffer); break; case MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MONTH); if (p.size < 3) withLeadingZeros (calendar.get (Calendar.MONTH) + 1, p.size, buffer); else if (p.size < 4) buffer.append (formatData.shortMonths[calendar.get (Calendar.MONTH)]); else buffer.append (formatData.months[calendar.get (Calendar.MONTH)]); break; case DATE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_MONTH); withLeadingZeros (calendar.get (Calendar.DATE), p.size, buffer); break; case HOUR_OF_DAY1_FIELD: // 1-24 buffer.setDefaultAttribute(DateFormat.Field.HOUR_OF_DAY1); withLeadingZeros ( ((calendar.get (Calendar.HOUR_OF_DAY) + 23) % 24) + 1, p.size, buffer); break; case HOUR_OF_DAY0_FIELD: // 0-23 buffer.setDefaultAttribute (DateFormat.Field.HOUR_OF_DAY0); withLeadingZeros (calendar.get (Calendar.HOUR_OF_DAY), p.size, buffer); break; case MINUTE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MINUTE); withLeadingZeros (calendar.get (Calendar.MINUTE), p.size, buffer); break; case SECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.SECOND); withLeadingZeros(calendar.get (Calendar.SECOND), p.size, buffer); break; case MILLISECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MILLISECOND); withLeadingZeros (calendar.get (Calendar.MILLISECOND), p.size, buffer); break; case DAY_OF_WEEK_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK); if (p.size < 4) buffer.append (formatData.shortWeekdays[calendar.get (Calendar.DAY_OF_WEEK)]); else buffer.append (formatData.weekdays[calendar.get (Calendar.DAY_OF_WEEK)]); break; case DAY_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_YEAR); withLeadingZeros (calendar.get (Calendar.DAY_OF_YEAR), p.size, buffer); break; case DAY_OF_WEEK_IN_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK_IN_MONTH); withLeadingZeros (calendar.get (Calendar.DAY_OF_WEEK_IN_MONTH), p.size, buffer); break; case WEEK_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_YEAR); withLeadingZeros (calendar.get (Calendar.WEEK_OF_YEAR), p.size, buffer); break; case WEEK_OF_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_MONTH); withLeadingZeros (calendar.get (Calendar.WEEK_OF_MONTH), p.size, buffer); break; case AM_PM_FIELD: buffer.setDefaultAttribute (DateFormat.Field.AM_PM); buffer.append (formatData.ampms[calendar.get (Calendar.AM_PM)]); break; case HOUR1_FIELD: // 1-12 buffer.setDefaultAttribute (DateFormat.Field.HOUR1); withLeadingZeros (((calendar.get (Calendar.HOUR) + 11) % 12) + 1, p.size, buffer); break; case HOUR0_FIELD: // 0-11 buffer.setDefaultAttribute (DateFormat.Field.HOUR0); withLeadingZeros (calendar.get (Calendar.HOUR), p.size, buffer); break; case TIMEZONE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.TIME_ZONE); TimeZone zone = calendar.getTimeZone(); boolean isDST = calendar.get (Calendar.DST_OFFSET) != 0; // FIXME: XXX: This should be a localized time zone. String zoneID = zone.getDisplayName (isDST, p.size > 3 ? TimeZone.LONG : TimeZone.SHORT); buffer.append (zoneID); break; default: throw new IllegalArgumentException ("Illegal pattern character " + p.field); } if (pos != null && (buffer.getDefaultAttribute() == pos.getFieldAttribute() || p.field == pos.getField())) { pos.setBeginIndex(beginIndex); pos.setEndIndex(buffer.length()); } } else { buffer.append(o.toString(), null); } } }
| 11,410
|
private void formatWithAttribute(Date date, FormatBuffer buffer, FieldPosition pos) { String temp; AttributedCharacterIterator.Attribute attribute; calendar.setTime(date); // go through vector, filling in fields where applicable, else toString Iterator iter = tokens.iterator(); while (iter.hasNext()) { Object o = iter.next(); if (o instanceof FieldSizePair) { FieldSizePair p = (FieldSizePair) o; int beginIndex = buffer.length(); switch (p.field) { case ERA_FIELD: buffer.append (formatData.eras[calendar.get (Calendar.ERA)], DateFormat.Field.ERA); break; case YEAR_FIELD: // If we have two digits, then we truncate. Otherwise, we // use the size of the pattern, and zero pad. buffer.setDefaultAttribute (DateFormat.Field.YEAR); if (p.size == 2) { temp = String.valueOf (calendar.get (Calendar.YEAR)); buffer.append (temp.substring (temp.length() - 2)); } else withLeadingZeros (calendar.get (Calendar.YEAR), p.size, buffer); break; case MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MONTH); if (p.size < 3) withLeadingZeros (calendar.get (Calendar.MONTH) + 1, p.size, buffer); else if (p.size < 4) buffer.append (formatData.shortMonths[calendar.get (Calendar.MONTH)]); else buffer.append (formatData.months[calendar.get (Calendar.MONTH)]); break; case DATE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_MONTH); withLeadingZeros (calendar.get (Calendar.DATE), p.size, buffer); break; case HOUR_OF_DAY1_FIELD: // 1-24 buffer.setDefaultAttribute(DateFormat.Field.HOUR_OF_DAY1); withLeadingZeros ( ((calendar.get (Calendar.HOUR_OF_DAY) + 23) % 24) + 1, p.size, buffer); break; case HOUR_OF_DAY0_FIELD: // 0-23 buffer.setDefaultAttribute (DateFormat.Field.HOUR_OF_DAY0); withLeadingZeros (calendar.get (Calendar.HOUR_OF_DAY), p.size, buffer); break; case MINUTE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MINUTE); withLeadingZeros (calendar.get (Calendar.MINUTE), p.size, buffer); break; case SECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.SECOND); withLeadingZeros(calendar.get (Calendar.SECOND), p.size, buffer); break; case MILLISECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MILLISECOND); withLeadingZeros (calendar.get (Calendar.MILLISECOND), p.size, buffer); break; case DAY_OF_WEEK_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK); if (p.size < 4) buffer.append (formatData.shortWeekdays[calendar.get (Calendar.DAY_OF_WEEK)]); else buffer.append (formatData.weekdays[calendar.get (Calendar.DAY_OF_WEEK)]); break; case DAY_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_YEAR); withLeadingZeros (calendar.get (Calendar.DAY_OF_YEAR), p.size, buffer); break; case DAY_OF_WEEK_IN_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK_IN_MONTH); withLeadingZeros (calendar.get (Calendar.DAY_OF_WEEK_IN_MONTH), p.size, buffer); break; case WEEK_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_YEAR); withLeadingZeros (calendar.get (Calendar.WEEK_OF_YEAR), p.size, buffer); break; case WEEK_OF_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_MONTH); withLeadingZeros (calendar.get (Calendar.WEEK_OF_MONTH), p.size, buffer); break; case AM_PM_FIELD: buffer.setDefaultAttribute (DateFormat.Field.AM_PM); buffer.append (formatData.ampms[calendar.get (Calendar.AM_PM)]); break; case HOUR1_FIELD: // 1-12 buffer.setDefaultAttribute (DateFormat.Field.HOUR1); withLeadingZeros (((calendar.get (Calendar.HOUR) + 11) % 12) + 1, p.size, buffer); break; case HOUR0_FIELD: // 0-11 buffer.setDefaultAttribute (DateFormat.Field.HOUR0); withLeadingZeros (calendar.get (Calendar.HOUR), p.size, buffer); break; case TIMEZONE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.TIME_ZONE); TimeZone zone = calendar.getTimeZone(); boolean isDST = calendar.get (Calendar.DST_OFFSET) != 0; // FIXME: XXX: This should be a localized time zone. String zoneID = zone.getDisplayName (isDST, p.size > 3 ? TimeZone.LONG : TimeZone.SHORT); buffer.append (zoneID); break; default: throw new IllegalArgumentException ("Illegal pattern character " + p.field); } if (pos != null && (buffer.getDefaultAttribute() == pos.getFieldAttribute() || p.field == pos.getField())) { pos.setBeginIndex(beginIndex); pos.setEndIndex(buffer.length()); } } else { buffer.append(o.toString(), null); } } }
|
private void formatWithAttribute(Date date, FormatBuffer buffer, FieldPosition pos) { String temp; AttributedCharacterIterator.Attribute attribute; calendar.setTime(date); // go through vector, filling in fields where applicable, else toString Iterator iter = tokens.iterator(); while (iter.hasNext()) { Object o = iter.next(); if (o instanceof FieldSizePair) { FieldSizePair p = (FieldSizePair) o; int beginIndex = buffer.length(); switch (p.field) { case ERA_FIELD: buffer.append (formatData.eras[calendar.get (Calendar.ERA)], DateFormat.Field.ERA); break; case YEAR_FIELD: // If we have two digits, then we truncate. Otherwise, we // use the size of the pattern, and zero pad. buffer.setDefaultAttribute (DateFormat.Field.YEAR); if (p.size == 2) { temp = String.valueOf (calendar.get (Calendar.YEAR)); buffer.append (temp.substring (temp.length() - 2)); } else withLeadingZeros (calendar.get (Calendar.YEAR), p.size, buffer); break; case MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MONTH); if (p.size < 3) withLeadingZeros (calendar.get (Calendar.MONTH) + 1, p.size, buffer); else if (p.size < 4) buffer.append (formatData.shortMonths[calendar.get (Calendar.MONTH)]); else buffer.append (formatData.months[calendar.get (Calendar.MONTH)]); break; case DATE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_MONTH); withLeadingZeros (calendar.get (Calendar.DATE), p.size, buffer); break; case HOUR_OF_DAY1_FIELD: // 1-24 buffer.setDefaultAttribute(DateFormat.Field.HOUR_OF_DAY1); withLeadingZeros ( ((calendar.get (Calendar.HOUR_OF_DAY) + 23) % 24) + 1, p.size, buffer); break; case HOUR_OF_DAY0_FIELD: // 0-23 buffer.setDefaultAttribute (DateFormat.Field.HOUR_OF_DAY0); withLeadingZeros (calendar.get (Calendar.HOUR_OF_DAY), p.size, buffer); break; case MINUTE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MINUTE); withLeadingZeros (calendar.get (Calendar.MINUTE), p.size, buffer); break; case SECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.SECOND); withLeadingZeros(calendar.get (Calendar.SECOND), p.size, buffer); break; case MILLISECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MILLISECOND); withLeadingZeros (calendar.get (Calendar.MILLISECOND), p.size, buffer); break; case DAY_OF_WEEK_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK); if (p.size < 4) buffer.append (formatData.shortWeekdays[calendar.get (Calendar.DAY_OF_WEEK)]); else buffer.append (formatData.weekdays[calendar.get (Calendar.DAY_OF_WEEK)]); break; case DAY_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_YEAR); withLeadingZeros (calendar.get (Calendar.DAY_OF_YEAR), p.size, buffer); break; case DAY_OF_WEEK_IN_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK_IN_MONTH); withLeadingZeros (calendar.get (Calendar.DAY_OF_WEEK_IN_MONTH), p.size, buffer); break; case WEEK_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_YEAR); withLeadingZeros (calendar.get (Calendar.WEEK_OF_YEAR), p.size, buffer); break; case WEEK_OF_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_MONTH); withLeadingZeros (calendar.get (Calendar.WEEK_OF_MONTH), p.size, buffer); break; case AM_PM_FIELD: buffer.setDefaultAttribute (DateFormat.Field.AM_PM); buffer.append (formatData.ampms[calendar.get (Calendar.AM_PM)]); break; case HOUR1_FIELD: // 1-12 buffer.setDefaultAttribute (DateFormat.Field.HOUR1); withLeadingZeros (((calendar.get (Calendar.HOUR) + 11) % 12) + 1, p.size, buffer); break; case HOUR0_FIELD: // 0-11 buffer.setDefaultAttribute (DateFormat.Field.HOUR0); withLeadingZeros (calendar.get (Calendar.HOUR), p.size, buffer); break; case TIMEZONE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.TIME_ZONE); TimeZone zone = calendar.getTimeZone(); boolean isDST = calendar.get (Calendar.DST_OFFSET) != 0; // FIXME: XXX: This should be a localized time zone. String zoneID = zone.getDisplayName (isDST, p.size > 3 ? TimeZone.LONG : TimeZone.SHORT); buffer.append (zoneID); break; default: throw new IllegalArgumentException ("Illegal pattern character " + p.field); } if (pos != null && (buffer.getDefaultAttribute() == pos.getFieldAttribute() || p.field == pos.getField())) { pos.setBeginIndex(beginIndex); pos.setEndIndex(buffer.length()); } } else { buffer.append(o.toString(), null); } } }
| 11,411
|
private void formatWithAttribute(Date date, FormatBuffer buffer, FieldPosition pos) { String temp; AttributedCharacterIterator.Attribute attribute; calendar.setTime(date); // go through vector, filling in fields where applicable, else toString Iterator iter = tokens.iterator(); while (iter.hasNext()) { Object o = iter.next(); if (o instanceof FieldSizePair) { FieldSizePair p = (FieldSizePair) o; int beginIndex = buffer.length(); switch (p.field) { case ERA_FIELD: buffer.append (formatData.eras[calendar.get (Calendar.ERA)], DateFormat.Field.ERA); break; case YEAR_FIELD: // If we have two digits, then we truncate. Otherwise, we // use the size of the pattern, and zero pad. buffer.setDefaultAttribute (DateFormat.Field.YEAR); if (p.size == 2) { temp = String.valueOf (calendar.get (Calendar.YEAR)); buffer.append (temp.substring (temp.length() - 2)); } else withLeadingZeros (calendar.get (Calendar.YEAR), p.size, buffer); break; case MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MONTH); if (p.size < 3) withLeadingZeros (calendar.get (Calendar.MONTH) + 1, p.size, buffer); else if (p.size < 4) buffer.append (formatData.shortMonths[calendar.get (Calendar.MONTH)]); else buffer.append (formatData.months[calendar.get (Calendar.MONTH)]); break; case DATE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_MONTH); withLeadingZeros (calendar.get (Calendar.DATE), p.size, buffer); break; case HOUR_OF_DAY1_FIELD: // 1-24 buffer.setDefaultAttribute(DateFormat.Field.HOUR_OF_DAY1); withLeadingZeros ( ((calendar.get (Calendar.HOUR_OF_DAY) + 23) % 24) + 1, p.size, buffer); break; case HOUR_OF_DAY0_FIELD: // 0-23 buffer.setDefaultAttribute (DateFormat.Field.HOUR_OF_DAY0); withLeadingZeros (calendar.get (Calendar.HOUR_OF_DAY), p.size, buffer); break; case MINUTE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MINUTE); withLeadingZeros (calendar.get (Calendar.MINUTE), p.size, buffer); break; case SECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.SECOND); withLeadingZeros(calendar.get (Calendar.SECOND), p.size, buffer); break; case MILLISECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MILLISECOND); withLeadingZeros (calendar.get (Calendar.MILLISECOND), p.size, buffer); break; case DAY_OF_WEEK_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK); if (p.size < 4) buffer.append (formatData.shortWeekdays[calendar.get (Calendar.DAY_OF_WEEK)]); else buffer.append (formatData.weekdays[calendar.get (Calendar.DAY_OF_WEEK)]); break; case DAY_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_YEAR); withLeadingZeros (calendar.get (Calendar.DAY_OF_YEAR), p.size, buffer); break; case DAY_OF_WEEK_IN_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK_IN_MONTH); withLeadingZeros (calendar.get (Calendar.DAY_OF_WEEK_IN_MONTH), p.size, buffer); break; case WEEK_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_YEAR); withLeadingZeros (calendar.get (Calendar.WEEK_OF_YEAR), p.size, buffer); break; case WEEK_OF_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_MONTH); withLeadingZeros (calendar.get (Calendar.WEEK_OF_MONTH), p.size, buffer); break; case AM_PM_FIELD: buffer.setDefaultAttribute (DateFormat.Field.AM_PM); buffer.append (formatData.ampms[calendar.get (Calendar.AM_PM)]); break; case HOUR1_FIELD: // 1-12 buffer.setDefaultAttribute (DateFormat.Field.HOUR1); withLeadingZeros (((calendar.get (Calendar.HOUR) + 11) % 12) + 1, p.size, buffer); break; case HOUR0_FIELD: // 0-11 buffer.setDefaultAttribute (DateFormat.Field.HOUR0); withLeadingZeros (calendar.get (Calendar.HOUR), p.size, buffer); break; case TIMEZONE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.TIME_ZONE); TimeZone zone = calendar.getTimeZone(); boolean isDST = calendar.get (Calendar.DST_OFFSET) != 0; // FIXME: XXX: This should be a localized time zone. String zoneID = zone.getDisplayName (isDST, p.size > 3 ? TimeZone.LONG : TimeZone.SHORT); buffer.append (zoneID); break; default: throw new IllegalArgumentException ("Illegal pattern character " + p.field); } if (pos != null && (buffer.getDefaultAttribute() == pos.getFieldAttribute() || p.field == pos.getField())) { pos.setBeginIndex(beginIndex); pos.setEndIndex(buffer.length()); } } else { buffer.append(o.toString(), null); } } }
|
private void formatWithAttribute(Date date, FormatBuffer buffer, FieldPosition pos) { String temp; AttributedCharacterIterator.Attribute attribute; calendar.setTime(date); // go through vector, filling in fields where applicable, else toString Iterator iter = tokens.iterator(); while (iter.hasNext()) { Object o = iter.next(); if (o instanceof FieldSizePair) { FieldSizePair p = (FieldSizePair) o; int beginIndex = buffer.length(); switch (p.field) { case ERA_FIELD: buffer.append (formatData.eras[calendar.get (Calendar.ERA)], DateFormat.Field.ERA); break; case YEAR_FIELD: // If we have two digits, then we truncate. Otherwise, we // use the size of the pattern, and zero pad. buffer.setDefaultAttribute (DateFormat.Field.YEAR); if (p.size == 2) { temp = String.valueOf (calendar.get (Calendar.YEAR)); buffer.append (temp.substring (temp.length() - 2)); } else withLeadingZeros (calendar.get (Calendar.YEAR), p.size, buffer); break; case MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MONTH); if (p.size < 3) withLeadingZeros (calendar.get (Calendar.MONTH) + 1, p.size, buffer); else if (p.size < 4) buffer.append (formatData.shortMonths[calendar.get (Calendar.MONTH)]); else buffer.append (formatData.months[calendar.get (Calendar.MONTH)]); break; case DATE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_MONTH); withLeadingZeros (calendar.get (Calendar.DATE), p.size, buffer); break; case HOUR_OF_DAY1_FIELD: // 1-24 buffer.setDefaultAttribute(DateFormat.Field.HOUR_OF_DAY1); withLeadingZeros ( ((calendar.get (Calendar.HOUR_OF_DAY) + 23) % 24) + 1, p.size, buffer); break; case HOUR_OF_DAY0_FIELD: // 0-23 buffer.setDefaultAttribute (DateFormat.Field.HOUR_OF_DAY0); withLeadingZeros (calendar.get (Calendar.HOUR_OF_DAY), p.size, buffer); break; case MINUTE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MINUTE); withLeadingZeros (calendar.get (Calendar.MINUTE), p.size, buffer); break; case SECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.SECOND); withLeadingZeros(calendar.get (Calendar.SECOND), p.size, buffer); break; case MILLISECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MILLISECOND); withLeadingZeros (calendar.get (Calendar.MILLISECOND), p.size, buffer); break; case DAY_OF_WEEK_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK); if (p.size < 4) buffer.append (formatData.shortWeekdays[calendar.get (Calendar.DAY_OF_WEEK)]); else buffer.append (formatData.weekdays[calendar.get (Calendar.DAY_OF_WEEK)]); break; case DAY_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_YEAR); withLeadingZeros (calendar.get (Calendar.DAY_OF_YEAR), p.size, buffer); break; case DAY_OF_WEEK_IN_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK_IN_MONTH); withLeadingZeros (calendar.get (Calendar.DAY_OF_WEEK_IN_MONTH), p.size, buffer); break; case WEEK_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_YEAR); withLeadingZeros (calendar.get (Calendar.WEEK_OF_YEAR), p.size, buffer); break; case WEEK_OF_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_MONTH); withLeadingZeros (calendar.get (Calendar.WEEK_OF_MONTH), p.size, buffer); break; case AM_PM_FIELD: buffer.setDefaultAttribute (DateFormat.Field.AM_PM); buffer.append (formatData.ampms[calendar.get (Calendar.AM_PM)]); break; case HOUR1_FIELD: // 1-12 buffer.setDefaultAttribute (DateFormat.Field.HOUR1); withLeadingZeros (((calendar.get (Calendar.HOUR) + 11) % 12) + 1, p.size, buffer); break; case HOUR0_FIELD: // 0-11 buffer.setDefaultAttribute (DateFormat.Field.HOUR0); withLeadingZeros (calendar.get (Calendar.HOUR), p.size, buffer); break; case TIMEZONE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.TIME_ZONE); TimeZone zone = calendar.getTimeZone(); boolean isDST = calendar.get (Calendar.DST_OFFSET) != 0; // FIXME: XXX: This should be a localized time zone. String zoneID = zone.getDisplayName (isDST, p.size > 3 ? TimeZone.LONG : TimeZone.SHORT); buffer.append (zoneID); break; default: throw new IllegalArgumentException ("Illegal pattern character " + p.field); } if (pos != null && (buffer.getDefaultAttribute() == pos.getFieldAttribute() || p.field == pos.getField())) { pos.setBeginIndex(beginIndex); pos.setEndIndex(buffer.length()); } } else { buffer.append(o.toString(), null); } } }
| 11,412
|
private void formatWithAttribute(Date date, FormatBuffer buffer, FieldPosition pos) { String temp; AttributedCharacterIterator.Attribute attribute; calendar.setTime(date); // go through vector, filling in fields where applicable, else toString Iterator iter = tokens.iterator(); while (iter.hasNext()) { Object o = iter.next(); if (o instanceof FieldSizePair) { FieldSizePair p = (FieldSizePair) o; int beginIndex = buffer.length(); switch (p.field) { case ERA_FIELD: buffer.append (formatData.eras[calendar.get (Calendar.ERA)], DateFormat.Field.ERA); break; case YEAR_FIELD: // If we have two digits, then we truncate. Otherwise, we // use the size of the pattern, and zero pad. buffer.setDefaultAttribute (DateFormat.Field.YEAR); if (p.size == 2) { temp = String.valueOf (calendar.get (Calendar.YEAR)); buffer.append (temp.substring (temp.length() - 2)); } else withLeadingZeros (calendar.get (Calendar.YEAR), p.size, buffer); break; case MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MONTH); if (p.size < 3) withLeadingZeros (calendar.get (Calendar.MONTH) + 1, p.size, buffer); else if (p.size < 4) buffer.append (formatData.shortMonths[calendar.get (Calendar.MONTH)]); else buffer.append (formatData.months[calendar.get (Calendar.MONTH)]); break; case DATE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_MONTH); withLeadingZeros (calendar.get (Calendar.DATE), p.size, buffer); break; case HOUR_OF_DAY1_FIELD: // 1-24 buffer.setDefaultAttribute(DateFormat.Field.HOUR_OF_DAY1); withLeadingZeros ( ((calendar.get (Calendar.HOUR_OF_DAY) + 23) % 24) + 1, p.size, buffer); break; case HOUR_OF_DAY0_FIELD: // 0-23 buffer.setDefaultAttribute (DateFormat.Field.HOUR_OF_DAY0); withLeadingZeros (calendar.get (Calendar.HOUR_OF_DAY), p.size, buffer); break; case MINUTE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MINUTE); withLeadingZeros (calendar.get (Calendar.MINUTE), p.size, buffer); break; case SECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.SECOND); withLeadingZeros(calendar.get (Calendar.SECOND), p.size, buffer); break; case MILLISECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MILLISECOND); withLeadingZeros (calendar.get (Calendar.MILLISECOND), p.size, buffer); break; case DAY_OF_WEEK_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK); if (p.size < 4) buffer.append (formatData.shortWeekdays[calendar.get (Calendar.DAY_OF_WEEK)]); else buffer.append (formatData.weekdays[calendar.get (Calendar.DAY_OF_WEEK)]); break; case DAY_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_YEAR); withLeadingZeros (calendar.get (Calendar.DAY_OF_YEAR), p.size, buffer); break; case DAY_OF_WEEK_IN_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK_IN_MONTH); withLeadingZeros (calendar.get (Calendar.DAY_OF_WEEK_IN_MONTH), p.size, buffer); break; case WEEK_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_YEAR); withLeadingZeros (calendar.get (Calendar.WEEK_OF_YEAR), p.size, buffer); break; case WEEK_OF_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_MONTH); withLeadingZeros (calendar.get (Calendar.WEEK_OF_MONTH), p.size, buffer); break; case AM_PM_FIELD: buffer.setDefaultAttribute (DateFormat.Field.AM_PM); buffer.append (formatData.ampms[calendar.get (Calendar.AM_PM)]); break; case HOUR1_FIELD: // 1-12 buffer.setDefaultAttribute (DateFormat.Field.HOUR1); withLeadingZeros (((calendar.get (Calendar.HOUR) + 11) % 12) + 1, p.size, buffer); break; case HOUR0_FIELD: // 0-11 buffer.setDefaultAttribute (DateFormat.Field.HOUR0); withLeadingZeros (calendar.get (Calendar.HOUR), p.size, buffer); break; case TIMEZONE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.TIME_ZONE); TimeZone zone = calendar.getTimeZone(); boolean isDST = calendar.get (Calendar.DST_OFFSET) != 0; // FIXME: XXX: This should be a localized time zone. String zoneID = zone.getDisplayName (isDST, p.size > 3 ? TimeZone.LONG : TimeZone.SHORT); buffer.append (zoneID); break; default: throw new IllegalArgumentException ("Illegal pattern character " + p.field); } if (pos != null && (buffer.getDefaultAttribute() == pos.getFieldAttribute() || p.field == pos.getField())) { pos.setBeginIndex(beginIndex); pos.setEndIndex(buffer.length()); } } else { buffer.append(o.toString(), null); } } }
|
private void formatWithAttribute(Date date, FormatBuffer buffer, FieldPosition pos) { String temp; AttributedCharacterIterator.Attribute attribute; calendar.setTime(date); // go through vector, filling in fields where applicable, else toString Iterator iter = tokens.iterator(); while (iter.hasNext()) { Object o = iter.next(); if (o instanceof FieldSizePair) { FieldSizePair p = (FieldSizePair) o; int beginIndex = buffer.length(); switch (p.field) { case ERA_FIELD: buffer.append (formatData.eras[calendar.get (Calendar.ERA)], DateFormat.Field.ERA); break; case YEAR_FIELD: // If we have two digits, then we truncate. Otherwise, we // use the size of the pattern, and zero pad. buffer.setDefaultAttribute (DateFormat.Field.YEAR); if (p.size == 2) { temp = String.valueOf (calendar.get (Calendar.YEAR)); buffer.append (temp.substring (temp.length() - 2)); } else withLeadingZeros (calendar.get (Calendar.YEAR), p.size, buffer); break; case MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MONTH); if (p.size < 3) withLeadingZeros (calendar.get (Calendar.MONTH) + 1, p.size, buffer); else if (p.size < 4) buffer.append (formatData.shortMonths[calendar.get (Calendar.MONTH)]); else buffer.append (formatData.months[calendar.get (Calendar.MONTH)]); break; case DATE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_MONTH); withLeadingZeros (calendar.get (Calendar.DATE), p.size, buffer); break; case HOUR_OF_DAY1_FIELD: // 1-24 buffer.setDefaultAttribute(DateFormat.Field.HOUR_OF_DAY1); withLeadingZeros ( ((calendar.get (Calendar.HOUR_OF_DAY) + 23) % 24) + 1, p.size, buffer); break; case HOUR_OF_DAY0_FIELD: // 0-23 buffer.setDefaultAttribute (DateFormat.Field.HOUR_OF_DAY0); withLeadingZeros (calendar.get (Calendar.HOUR_OF_DAY), p.size, buffer); break; case MINUTE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MINUTE); withLeadingZeros (calendar.get (Calendar.MINUTE), p.size, buffer); break; case SECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.SECOND); withLeadingZeros(calendar.get (Calendar.SECOND), p.size, buffer); break; case MILLISECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MILLISECOND); withLeadingZeros (calendar.get (Calendar.MILLISECOND), p.size, buffer); break; case DAY_OF_WEEK_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK); if (p.size < 4) buffer.append (formatData.shortWeekdays[calendar.get (Calendar.DAY_OF_WEEK)]); else buffer.append (formatData.weekdays[calendar.get (Calendar.DAY_OF_WEEK)]); break; case DAY_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_YEAR); withLeadingZeros (calendar.get (Calendar.DAY_OF_YEAR), p.size, buffer); break; case DAY_OF_WEEK_IN_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK_IN_MONTH); withLeadingZeros (calendar.get (Calendar.DAY_OF_WEEK_IN_MONTH), p.size, buffer); break; case WEEK_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_YEAR); withLeadingZeros (calendar.get (Calendar.WEEK_OF_YEAR), p.size, buffer); break; case WEEK_OF_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_MONTH); withLeadingZeros (calendar.get (Calendar.WEEK_OF_MONTH), p.size, buffer); break; case AM_PM_FIELD: buffer.setDefaultAttribute (DateFormat.Field.AM_PM); buffer.append (formatData.ampms[calendar.get (Calendar.AM_PM)]); break; case HOUR1_FIELD: // 1-12 buffer.setDefaultAttribute (DateFormat.Field.HOUR1); withLeadingZeros (((calendar.get (Calendar.HOUR) + 11) % 12) + 1, p.size, buffer); break; case HOUR0_FIELD: // 0-11 buffer.setDefaultAttribute (DateFormat.Field.HOUR0); withLeadingZeros (calendar.get (Calendar.HOUR), p.size, buffer); break; case TIMEZONE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.TIME_ZONE); TimeZone zone = calendar.getTimeZone(); boolean isDST = calendar.get (Calendar.DST_OFFSET) != 0; // FIXME: XXX: This should be a localized time zone. String zoneID = zone.getDisplayName (isDST, p.size > 3 ? TimeZone.LONG : TimeZone.SHORT); buffer.append (zoneID); break; default: throw new IllegalArgumentException ("Illegal pattern character " + p.field); } if (pos != null && (buffer.getDefaultAttribute() == pos.getFieldAttribute() || p.field == pos.getField())) { pos.setBeginIndex(beginIndex); pos.setEndIndex(buffer.length()); } } else { buffer.append(o.toString(), null); } } }
| 11,413
|
private void formatWithAttribute(Date date, FormatBuffer buffer, FieldPosition pos) { String temp; AttributedCharacterIterator.Attribute attribute; calendar.setTime(date); // go through vector, filling in fields where applicable, else toString Iterator iter = tokens.iterator(); while (iter.hasNext()) { Object o = iter.next(); if (o instanceof FieldSizePair) { FieldSizePair p = (FieldSizePair) o; int beginIndex = buffer.length(); switch (p.field) { case ERA_FIELD: buffer.append (formatData.eras[calendar.get (Calendar.ERA)], DateFormat.Field.ERA); break; case YEAR_FIELD: // If we have two digits, then we truncate. Otherwise, we // use the size of the pattern, and zero pad. buffer.setDefaultAttribute (DateFormat.Field.YEAR); if (p.size == 2) { temp = String.valueOf (calendar.get (Calendar.YEAR)); buffer.append (temp.substring (temp.length() - 2)); } else withLeadingZeros (calendar.get (Calendar.YEAR), p.size, buffer); break; case MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MONTH); if (p.size < 3) withLeadingZeros (calendar.get (Calendar.MONTH) + 1, p.size, buffer); else if (p.size < 4) buffer.append (formatData.shortMonths[calendar.get (Calendar.MONTH)]); else buffer.append (formatData.months[calendar.get (Calendar.MONTH)]); break; case DATE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_MONTH); withLeadingZeros (calendar.get (Calendar.DATE), p.size, buffer); break; case HOUR_OF_DAY1_FIELD: // 1-24 buffer.setDefaultAttribute(DateFormat.Field.HOUR_OF_DAY1); withLeadingZeros ( ((calendar.get (Calendar.HOUR_OF_DAY) + 23) % 24) + 1, p.size, buffer); break; case HOUR_OF_DAY0_FIELD: // 0-23 buffer.setDefaultAttribute (DateFormat.Field.HOUR_OF_DAY0); withLeadingZeros (calendar.get (Calendar.HOUR_OF_DAY), p.size, buffer); break; case MINUTE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MINUTE); withLeadingZeros (calendar.get (Calendar.MINUTE), p.size, buffer); break; case SECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.SECOND); withLeadingZeros(calendar.get (Calendar.SECOND), p.size, buffer); break; case MILLISECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MILLISECOND); withLeadingZeros (calendar.get (Calendar.MILLISECOND), p.size, buffer); break; case DAY_OF_WEEK_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK); if (p.size < 4) buffer.append (formatData.shortWeekdays[calendar.get (Calendar.DAY_OF_WEEK)]); else buffer.append (formatData.weekdays[calendar.get (Calendar.DAY_OF_WEEK)]); break; case DAY_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_YEAR); withLeadingZeros (calendar.get (Calendar.DAY_OF_YEAR), p.size, buffer); break; case DAY_OF_WEEK_IN_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK_IN_MONTH); withLeadingZeros (calendar.get (Calendar.DAY_OF_WEEK_IN_MONTH), p.size, buffer); break; case WEEK_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_YEAR); withLeadingZeros (calendar.get (Calendar.WEEK_OF_YEAR), p.size, buffer); break; case WEEK_OF_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_MONTH); withLeadingZeros (calendar.get (Calendar.WEEK_OF_MONTH), p.size, buffer); break; case AM_PM_FIELD: buffer.setDefaultAttribute (DateFormat.Field.AM_PM); buffer.append (formatData.ampms[calendar.get (Calendar.AM_PM)]); break; case HOUR1_FIELD: // 1-12 buffer.setDefaultAttribute (DateFormat.Field.HOUR1); withLeadingZeros (((calendar.get (Calendar.HOUR) + 11) % 12) + 1, p.size, buffer); break; case HOUR0_FIELD: // 0-11 buffer.setDefaultAttribute (DateFormat.Field.HOUR0); withLeadingZeros (calendar.get (Calendar.HOUR), p.size, buffer); break; case TIMEZONE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.TIME_ZONE); TimeZone zone = calendar.getTimeZone(); boolean isDST = calendar.get (Calendar.DST_OFFSET) != 0; // FIXME: XXX: This should be a localized time zone. String zoneID = zone.getDisplayName (isDST, p.size > 3 ? TimeZone.LONG : TimeZone.SHORT); buffer.append (zoneID); break; default: throw new IllegalArgumentException ("Illegal pattern character " + p.field); } if (pos != null && (buffer.getDefaultAttribute() == pos.getFieldAttribute() || p.field == pos.getField())) { pos.setBeginIndex(beginIndex); pos.setEndIndex(buffer.length()); } } else { buffer.append(o.toString(), null); } } }
|
private void formatWithAttribute(Date date, FormatBuffer buffer, FieldPosition pos) { String temp; AttributedCharacterIterator.Attribute attribute; calendar.setTime(date); // go through vector, filling in fields where applicable, else toString Iterator iter = tokens.iterator(); while (iter.hasNext()) { Object o = iter.next(); if (o instanceof FieldSizePair) { FieldSizePair p = (FieldSizePair) o; int beginIndex = buffer.length(); switch (p.field) { case ERA_FIELD: buffer.append (formatData.eras[calendar.get (Calendar.ERA)], DateFormat.Field.ERA); break; case YEAR_FIELD: // If we have two digits, then we truncate. Otherwise, we // use the size of the pattern, and zero pad. buffer.setDefaultAttribute (DateFormat.Field.YEAR); if (p.size == 2) { temp = String.valueOf (calendar.get (Calendar.YEAR)); buffer.append (temp.substring (temp.length() - 2)); } else withLeadingZeros (calendar.get (Calendar.YEAR), p.size, buffer); break; case MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MONTH); if (p.size < 3) withLeadingZeros (calendar.get (Calendar.MONTH) + 1, p.size, buffer); else if (p.size < 4) buffer.append (formatData.shortMonths[calendar.get (Calendar.MONTH)]); else buffer.append (formatData.months[calendar.get (Calendar.MONTH)]); break; case DATE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_MONTH); withLeadingZeros (calendar.get (Calendar.DATE), p.size, buffer); break; case HOUR_OF_DAY1_FIELD: // 1-24 buffer.setDefaultAttribute(DateFormat.Field.HOUR_OF_DAY1); withLeadingZeros ( ((calendar.get (Calendar.HOUR_OF_DAY) + 23) % 24) + 1, p.size, buffer); break; case HOUR_OF_DAY0_FIELD: // 0-23 buffer.setDefaultAttribute (DateFormat.Field.HOUR_OF_DAY0); withLeadingZeros (calendar.get (Calendar.HOUR_OF_DAY), p.size, buffer); break; case MINUTE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MINUTE); withLeadingZeros (calendar.get (Calendar.MINUTE), p.size, buffer); break; case SECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.SECOND); withLeadingZeros(calendar.get (Calendar.SECOND), p.size, buffer); break; case MILLISECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MILLISECOND); withLeadingZeros (calendar.get (Calendar.MILLISECOND), p.size, buffer); break; case DAY_OF_WEEK_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK); if (p.size < 4) buffer.append (formatData.shortWeekdays[calendar.get (Calendar.DAY_OF_WEEK)]); else buffer.append (formatData.weekdays[calendar.get (Calendar.DAY_OF_WEEK)]); break; case DAY_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_YEAR); withLeadingZeros (calendar.get (Calendar.DAY_OF_YEAR), p.size, buffer); break; case DAY_OF_WEEK_IN_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK_IN_MONTH); withLeadingZeros (calendar.get (Calendar.DAY_OF_WEEK_IN_MONTH), p.size, buffer); break; case WEEK_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_YEAR); withLeadingZeros (calendar.get (Calendar.WEEK_OF_YEAR), p.size, buffer); break; case WEEK_OF_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_MONTH); withLeadingZeros (calendar.get (Calendar.WEEK_OF_MONTH), p.size, buffer); break; case AM_PM_FIELD: buffer.setDefaultAttribute (DateFormat.Field.AM_PM); buffer.append (formatData.ampms[calendar.get (Calendar.AM_PM)]); break; case HOUR1_FIELD: // 1-12 buffer.setDefaultAttribute (DateFormat.Field.HOUR1); withLeadingZeros (((calendar.get (Calendar.HOUR) + 11) % 12) + 1, p.size, buffer); break; case HOUR0_FIELD: // 0-11 buffer.setDefaultAttribute (DateFormat.Field.HOUR0); withLeadingZeros (calendar.get (Calendar.HOUR), p.size, buffer); break; case TIMEZONE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.TIME_ZONE); TimeZone zone = calendar.getTimeZone(); boolean isDST = calendar.get (Calendar.DST_OFFSET) != 0; // FIXME: XXX: This should be a localized time zone. String zoneID = zone.getDisplayName (isDST, p.size > 3 ? TimeZone.LONG : TimeZone.SHORT); buffer.append (zoneID); break; default: throw new IllegalArgumentException ("Illegal pattern character " + p.field); } if (pos != null && (buffer.getDefaultAttribute() == pos.getFieldAttribute() || p.field == pos.getField())) { pos.setBeginIndex(beginIndex); pos.setEndIndex(buffer.length()); } } else { buffer.append(o.toString(), null); } } }
| 11,414
|
private void formatWithAttribute(Date date, FormatBuffer buffer, FieldPosition pos) { String temp; AttributedCharacterIterator.Attribute attribute; calendar.setTime(date); // go through vector, filling in fields where applicable, else toString Iterator iter = tokens.iterator(); while (iter.hasNext()) { Object o = iter.next(); if (o instanceof FieldSizePair) { FieldSizePair p = (FieldSizePair) o; int beginIndex = buffer.length(); switch (p.field) { case ERA_FIELD: buffer.append (formatData.eras[calendar.get (Calendar.ERA)], DateFormat.Field.ERA); break; case YEAR_FIELD: // If we have two digits, then we truncate. Otherwise, we // use the size of the pattern, and zero pad. buffer.setDefaultAttribute (DateFormat.Field.YEAR); if (p.size == 2) { temp = String.valueOf (calendar.get (Calendar.YEAR)); buffer.append (temp.substring (temp.length() - 2)); } else withLeadingZeros (calendar.get (Calendar.YEAR), p.size, buffer); break; case MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MONTH); if (p.size < 3) withLeadingZeros (calendar.get (Calendar.MONTH) + 1, p.size, buffer); else if (p.size < 4) buffer.append (formatData.shortMonths[calendar.get (Calendar.MONTH)]); else buffer.append (formatData.months[calendar.get (Calendar.MONTH)]); break; case DATE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_MONTH); withLeadingZeros (calendar.get (Calendar.DATE), p.size, buffer); break; case HOUR_OF_DAY1_FIELD: // 1-24 buffer.setDefaultAttribute(DateFormat.Field.HOUR_OF_DAY1); withLeadingZeros ( ((calendar.get (Calendar.HOUR_OF_DAY) + 23) % 24) + 1, p.size, buffer); break; case HOUR_OF_DAY0_FIELD: // 0-23 buffer.setDefaultAttribute (DateFormat.Field.HOUR_OF_DAY0); withLeadingZeros (calendar.get (Calendar.HOUR_OF_DAY), p.size, buffer); break; case MINUTE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MINUTE); withLeadingZeros (calendar.get (Calendar.MINUTE), p.size, buffer); break; case SECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.SECOND); withLeadingZeros(calendar.get (Calendar.SECOND), p.size, buffer); break; case MILLISECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MILLISECOND); withLeadingZeros (calendar.get (Calendar.MILLISECOND), p.size, buffer); break; case DAY_OF_WEEK_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK); if (p.size < 4) buffer.append (formatData.shortWeekdays[calendar.get (Calendar.DAY_OF_WEEK)]); else buffer.append (formatData.weekdays[calendar.get (Calendar.DAY_OF_WEEK)]); break; case DAY_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_YEAR); withLeadingZeros (calendar.get (Calendar.DAY_OF_YEAR), p.size, buffer); break; case DAY_OF_WEEK_IN_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK_IN_MONTH); withLeadingZeros (calendar.get (Calendar.DAY_OF_WEEK_IN_MONTH), p.size, buffer); break; case WEEK_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_YEAR); withLeadingZeros (calendar.get (Calendar.WEEK_OF_YEAR), p.size, buffer); break; case WEEK_OF_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_MONTH); withLeadingZeros (calendar.get (Calendar.WEEK_OF_MONTH), p.size, buffer); break; case AM_PM_FIELD: buffer.setDefaultAttribute (DateFormat.Field.AM_PM); buffer.append (formatData.ampms[calendar.get (Calendar.AM_PM)]); break; case HOUR1_FIELD: // 1-12 buffer.setDefaultAttribute (DateFormat.Field.HOUR1); withLeadingZeros (((calendar.get (Calendar.HOUR) + 11) % 12) + 1, p.size, buffer); break; case HOUR0_FIELD: // 0-11 buffer.setDefaultAttribute (DateFormat.Field.HOUR0); withLeadingZeros (calendar.get (Calendar.HOUR), p.size, buffer); break; case TIMEZONE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.TIME_ZONE); TimeZone zone = calendar.getTimeZone(); boolean isDST = calendar.get (Calendar.DST_OFFSET) != 0; // FIXME: XXX: This should be a localized time zone. String zoneID = zone.getDisplayName (isDST, p.size > 3 ? TimeZone.LONG : TimeZone.SHORT); buffer.append (zoneID); break; default: throw new IllegalArgumentException ("Illegal pattern character " + p.field); } if (pos != null && (buffer.getDefaultAttribute() == pos.getFieldAttribute() || p.field == pos.getField())) { pos.setBeginIndex(beginIndex); pos.setEndIndex(buffer.length()); } } else { buffer.append(o.toString(), null); } } }
|
private void formatWithAttribute(Date date, FormatBuffer buffer, FieldPosition pos) { String temp; AttributedCharacterIterator.Attribute attribute; calendar.setTime(date); // go through vector, filling in fields where applicable, else toString Iterator iter = tokens.iterator(); while (iter.hasNext()) { Object o = iter.next(); if (o instanceof FieldSizePair) { FieldSizePair p = (FieldSizePair) o; int beginIndex = buffer.length(); switch (p.field) { case ERA_FIELD: buffer.append (formatData.eras[calendar.get (Calendar.ERA)], DateFormat.Field.ERA); break; case YEAR_FIELD: // If we have two digits, then we truncate. Otherwise, we // use the size of the pattern, and zero pad. buffer.setDefaultAttribute (DateFormat.Field.YEAR); if (p.size == 2) { temp = String.valueOf (calendar.get (Calendar.YEAR)); buffer.append (temp.substring (temp.length() - 2)); } else withLeadingZeros (calendar.get (Calendar.YEAR), p.size, buffer); break; case MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MONTH); if (p.size < 3) withLeadingZeros (calendar.get (Calendar.MONTH) + 1, p.size, buffer); else if (p.size < 4) buffer.append (formatData.shortMonths[calendar.get (Calendar.MONTH)]); else buffer.append (formatData.months[calendar.get (Calendar.MONTH)]); break; case DATE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_MONTH); withLeadingZeros (calendar.get (Calendar.DATE), p.size, buffer); break; case HOUR_OF_DAY1_FIELD: // 1-24 buffer.setDefaultAttribute(DateFormat.Field.HOUR_OF_DAY1); withLeadingZeros ( ((calendar.get (Calendar.HOUR_OF_DAY) + 23) % 24) + 1, p.size, buffer); break; case HOUR_OF_DAY0_FIELD: // 0-23 buffer.setDefaultAttribute (DateFormat.Field.HOUR_OF_DAY0); withLeadingZeros (calendar.get (Calendar.HOUR_OF_DAY), p.size, buffer); break; case MINUTE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MINUTE); withLeadingZeros (calendar.get (Calendar.MINUTE), p.size, buffer); break; case SECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.SECOND); withLeadingZeros(calendar.get (Calendar.SECOND), p.size, buffer); break; case MILLISECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MILLISECOND); withLeadingZeros (calendar.get (Calendar.MILLISECOND), p.size, buffer); break; case DAY_OF_WEEK_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK); if (p.size < 4) buffer.append (formatData.shortWeekdays[calendar.get (Calendar.DAY_OF_WEEK)]); else buffer.append (formatData.weekdays[calendar.get (Calendar.DAY_OF_WEEK)]); break; case DAY_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_YEAR); withLeadingZeros (calendar.get (Calendar.DAY_OF_YEAR), p.size, buffer); break; case DAY_OF_WEEK_IN_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK_IN_MONTH); withLeadingZeros (calendar.get (Calendar.DAY_OF_WEEK_IN_MONTH), p.size, buffer); break; case WEEK_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_YEAR); withLeadingZeros (calendar.get (Calendar.WEEK_OF_YEAR), p.size, buffer); break; case WEEK_OF_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_MONTH); withLeadingZeros (calendar.get (Calendar.WEEK_OF_MONTH), p.size, buffer); break; case AM_PM_FIELD: buffer.setDefaultAttribute (DateFormat.Field.AM_PM); buffer.append (formatData.ampms[calendar.get (Calendar.AM_PM)]); break; case HOUR1_FIELD: // 1-12 buffer.setDefaultAttribute (DateFormat.Field.HOUR1); withLeadingZeros (((calendar.get (Calendar.HOUR) + 11) % 12) + 1, p.size, buffer); break; case HOUR0_FIELD: // 0-11 buffer.setDefaultAttribute (DateFormat.Field.HOUR0); withLeadingZeros (calendar.get (Calendar.HOUR), p.size, buffer); break; case TIMEZONE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.TIME_ZONE); TimeZone zone = calendar.getTimeZone(); boolean isDST = calendar.get (Calendar.DST_OFFSET) != 0; // FIXME: XXX: This should be a localized time zone. String zoneID = zone.getDisplayName (isDST, p.size > 3 ? TimeZone.LONG : TimeZone.SHORT); buffer.append (zoneID); break; default: throw new IllegalArgumentException ("Illegal pattern character " + p.field); } if (pos != null && (buffer.getDefaultAttribute() == pos.getFieldAttribute() || p.field == pos.getField())) { pos.setBeginIndex(beginIndex); pos.setEndIndex(buffer.length()); } } else { buffer.append(o.toString(), null); } } }
| 11,415
|
private void formatWithAttribute(Date date, FormatBuffer buffer, FieldPosition pos) { String temp; AttributedCharacterIterator.Attribute attribute; calendar.setTime(date); // go through vector, filling in fields where applicable, else toString Iterator iter = tokens.iterator(); while (iter.hasNext()) { Object o = iter.next(); if (o instanceof FieldSizePair) { FieldSizePair p = (FieldSizePair) o; int beginIndex = buffer.length(); switch (p.field) { case ERA_FIELD: buffer.append (formatData.eras[calendar.get (Calendar.ERA)], DateFormat.Field.ERA); break; case YEAR_FIELD: // If we have two digits, then we truncate. Otherwise, we // use the size of the pattern, and zero pad. buffer.setDefaultAttribute (DateFormat.Field.YEAR); if (p.size == 2) { temp = String.valueOf (calendar.get (Calendar.YEAR)); buffer.append (temp.substring (temp.length() - 2)); } else withLeadingZeros (calendar.get (Calendar.YEAR), p.size, buffer); break; case MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MONTH); if (p.size < 3) withLeadingZeros (calendar.get (Calendar.MONTH) + 1, p.size, buffer); else if (p.size < 4) buffer.append (formatData.shortMonths[calendar.get (Calendar.MONTH)]); else buffer.append (formatData.months[calendar.get (Calendar.MONTH)]); break; case DATE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_MONTH); withLeadingZeros (calendar.get (Calendar.DATE), p.size, buffer); break; case HOUR_OF_DAY1_FIELD: // 1-24 buffer.setDefaultAttribute(DateFormat.Field.HOUR_OF_DAY1); withLeadingZeros ( ((calendar.get (Calendar.HOUR_OF_DAY) + 23) % 24) + 1, p.size, buffer); break; case HOUR_OF_DAY0_FIELD: // 0-23 buffer.setDefaultAttribute (DateFormat.Field.HOUR_OF_DAY0); withLeadingZeros (calendar.get (Calendar.HOUR_OF_DAY), p.size, buffer); break; case MINUTE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MINUTE); withLeadingZeros (calendar.get (Calendar.MINUTE), p.size, buffer); break; case SECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.SECOND); withLeadingZeros(calendar.get (Calendar.SECOND), p.size, buffer); break; case MILLISECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MILLISECOND); withLeadingZeros (calendar.get (Calendar.MILLISECOND), p.size, buffer); break; case DAY_OF_WEEK_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK); if (p.size < 4) buffer.append (formatData.shortWeekdays[calendar.get (Calendar.DAY_OF_WEEK)]); else buffer.append (formatData.weekdays[calendar.get (Calendar.DAY_OF_WEEK)]); break; case DAY_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_YEAR); withLeadingZeros (calendar.get (Calendar.DAY_OF_YEAR), p.size, buffer); break; case DAY_OF_WEEK_IN_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK_IN_MONTH); withLeadingZeros (calendar.get (Calendar.DAY_OF_WEEK_IN_MONTH), p.size, buffer); break; case WEEK_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_YEAR); withLeadingZeros (calendar.get (Calendar.WEEK_OF_YEAR), p.size, buffer); break; case WEEK_OF_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_MONTH); withLeadingZeros (calendar.get (Calendar.WEEK_OF_MONTH), p.size, buffer); break; case AM_PM_FIELD: buffer.setDefaultAttribute (DateFormat.Field.AM_PM); buffer.append (formatData.ampms[calendar.get (Calendar.AM_PM)]); break; case HOUR1_FIELD: // 1-12 buffer.setDefaultAttribute (DateFormat.Field.HOUR1); withLeadingZeros (((calendar.get (Calendar.HOUR) + 11) % 12) + 1, p.size, buffer); break; case HOUR0_FIELD: // 0-11 buffer.setDefaultAttribute (DateFormat.Field.HOUR0); withLeadingZeros (calendar.get (Calendar.HOUR), p.size, buffer); break; case TIMEZONE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.TIME_ZONE); TimeZone zone = calendar.getTimeZone(); boolean isDST = calendar.get (Calendar.DST_OFFSET) != 0; // FIXME: XXX: This should be a localized time zone. String zoneID = zone.getDisplayName (isDST, p.size > 3 ? TimeZone.LONG : TimeZone.SHORT); buffer.append (zoneID); break; default: throw new IllegalArgumentException ("Illegal pattern character " + p.field); } if (pos != null && (buffer.getDefaultAttribute() == pos.getFieldAttribute() || p.field == pos.getField())) { pos.setBeginIndex(beginIndex); pos.setEndIndex(buffer.length()); } } else { buffer.append(o.toString(), null); } } }
|
private void formatWithAttribute(Date date, FormatBuffer buffer, FieldPosition pos) { String temp; AttributedCharacterIterator.Attribute attribute; calendar.setTime(date); // go through vector, filling in fields where applicable, else toString Iterator iter = tokens.iterator(); while (iter.hasNext()) { Object o = iter.next(); if (o instanceof FieldSizePair) { FieldSizePair p = (FieldSizePair) o; int beginIndex = buffer.length(); switch (p.field) { case ERA_FIELD: buffer.append (formatData.eras[calendar.get (Calendar.ERA)], DateFormat.Field.ERA); break; case YEAR_FIELD: // If we have two digits, then we truncate. Otherwise, we // use the size of the pattern, and zero pad. buffer.setDefaultAttribute (DateFormat.Field.YEAR); if (p.size == 2) { temp = String.valueOf (calendar.get (Calendar.YEAR)); buffer.append (temp.substring (temp.length() - 2)); } else withLeadingZeros (calendar.get (Calendar.YEAR), p.size, buffer); break; case MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MONTH); if (p.size < 3) withLeadingZeros (calendar.get (Calendar.MONTH) + 1, p.size, buffer); else if (p.size < 4) buffer.append (formatData.shortMonths[calendar.get (Calendar.MONTH)]); else buffer.append (formatData.months[calendar.get (Calendar.MONTH)]); break; case DATE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_MONTH); withLeadingZeros (calendar.get (Calendar.DATE), p.size, buffer); break; case HOUR_OF_DAY1_FIELD: // 1-24 buffer.setDefaultAttribute(DateFormat.Field.HOUR_OF_DAY1); withLeadingZeros ( ((calendar.get (Calendar.HOUR_OF_DAY) + 23) % 24) + 1, p.size, buffer); break; case HOUR_OF_DAY0_FIELD: // 0-23 buffer.setDefaultAttribute (DateFormat.Field.HOUR_OF_DAY0); withLeadingZeros (calendar.get (Calendar.HOUR_OF_DAY), p.size, buffer); break; case MINUTE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MINUTE); withLeadingZeros (calendar.get (Calendar.MINUTE), p.size, buffer); break; case SECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.SECOND); withLeadingZeros(calendar.get (Calendar.SECOND), p.size, buffer); break; case MILLISECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MILLISECOND); withLeadingZeros (calendar.get (Calendar.MILLISECOND), p.size, buffer); break; case DAY_OF_WEEK_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK); if (p.size < 4) buffer.append (formatData.shortWeekdays[calendar.get (Calendar.DAY_OF_WEEK)]); else buffer.append (formatData.weekdays[calendar.get (Calendar.DAY_OF_WEEK)]); break; case DAY_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_YEAR); withLeadingZeros (calendar.get (Calendar.DAY_OF_YEAR), p.size, buffer); break; case DAY_OF_WEEK_IN_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK_IN_MONTH); withLeadingZeros (calendar.get (Calendar.DAY_OF_WEEK_IN_MONTH), p.size, buffer); break; case WEEK_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_YEAR); withLeadingZeros (calendar.get (Calendar.WEEK_OF_YEAR), p.size, buffer); break; case WEEK_OF_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_MONTH); withLeadingZeros (calendar.get (Calendar.WEEK_OF_MONTH), p.size, buffer); break; case AM_PM_FIELD: buffer.setDefaultAttribute (DateFormat.Field.AM_PM); buffer.append (formatData.ampms[calendar.get (Calendar.AM_PM)]); break; case HOUR1_FIELD: // 1-12 buffer.setDefaultAttribute (DateFormat.Field.HOUR1); withLeadingZeros (((calendar.get (Calendar.HOUR) + 11) % 12) + 1, p.size, buffer); break; case HOUR0_FIELD: // 0-11 buffer.setDefaultAttribute (DateFormat.Field.HOUR0); withLeadingZeros (calendar.get (Calendar.HOUR), p.size, buffer); break; case TIMEZONE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.TIME_ZONE); TimeZone zone = calendar.getTimeZone(); boolean isDST = calendar.get (Calendar.DST_OFFSET) != 0; // FIXME: XXX: This should be a localized time zone. String zoneID = zone.getDisplayName (isDST, p.size > 3 ? TimeZone.LONG : TimeZone.SHORT); buffer.append (zoneID); break; default: throw new IllegalArgumentException ("Illegal pattern character " + p.field); } if (pos != null && (buffer.getDefaultAttribute() == pos.getFieldAttribute() || p.field == pos.getField())) { pos.setBeginIndex(beginIndex); pos.setEndIndex(buffer.length()); } } else { buffer.append(o.toString(), null); } } }
| 11,416
|
private void formatWithAttribute(Date date, FormatBuffer buffer, FieldPosition pos) { String temp; AttributedCharacterIterator.Attribute attribute; calendar.setTime(date); // go through vector, filling in fields where applicable, else toString Iterator iter = tokens.iterator(); while (iter.hasNext()) { Object o = iter.next(); if (o instanceof FieldSizePair) { FieldSizePair p = (FieldSizePair) o; int beginIndex = buffer.length(); switch (p.field) { case ERA_FIELD: buffer.append (formatData.eras[calendar.get (Calendar.ERA)], DateFormat.Field.ERA); break; case YEAR_FIELD: // If we have two digits, then we truncate. Otherwise, we // use the size of the pattern, and zero pad. buffer.setDefaultAttribute (DateFormat.Field.YEAR); if (p.size == 2) { temp = String.valueOf (calendar.get (Calendar.YEAR)); buffer.append (temp.substring (temp.length() - 2)); } else withLeadingZeros (calendar.get (Calendar.YEAR), p.size, buffer); break; case MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MONTH); if (p.size < 3) withLeadingZeros (calendar.get (Calendar.MONTH) + 1, p.size, buffer); else if (p.size < 4) buffer.append (formatData.shortMonths[calendar.get (Calendar.MONTH)]); else buffer.append (formatData.months[calendar.get (Calendar.MONTH)]); break; case DATE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_MONTH); withLeadingZeros (calendar.get (Calendar.DATE), p.size, buffer); break; case HOUR_OF_DAY1_FIELD: // 1-24 buffer.setDefaultAttribute(DateFormat.Field.HOUR_OF_DAY1); withLeadingZeros ( ((calendar.get (Calendar.HOUR_OF_DAY) + 23) % 24) + 1, p.size, buffer); break; case HOUR_OF_DAY0_FIELD: // 0-23 buffer.setDefaultAttribute (DateFormat.Field.HOUR_OF_DAY0); withLeadingZeros (calendar.get (Calendar.HOUR_OF_DAY), p.size, buffer); break; case MINUTE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MINUTE); withLeadingZeros (calendar.get (Calendar.MINUTE), p.size, buffer); break; case SECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.SECOND); withLeadingZeros(calendar.get (Calendar.SECOND), p.size, buffer); break; case MILLISECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MILLISECOND); withLeadingZeros (calendar.get (Calendar.MILLISECOND), p.size, buffer); break; case DAY_OF_WEEK_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK); if (p.size < 4) buffer.append (formatData.shortWeekdays[calendar.get (Calendar.DAY_OF_WEEK)]); else buffer.append (formatData.weekdays[calendar.get (Calendar.DAY_OF_WEEK)]); break; case DAY_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_YEAR); withLeadingZeros (calendar.get (Calendar.DAY_OF_YEAR), p.size, buffer); break; case DAY_OF_WEEK_IN_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK_IN_MONTH); withLeadingZeros (calendar.get (Calendar.DAY_OF_WEEK_IN_MONTH), p.size, buffer); break; case WEEK_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_YEAR); withLeadingZeros (calendar.get (Calendar.WEEK_OF_YEAR), p.size, buffer); break; case WEEK_OF_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_MONTH); withLeadingZeros (calendar.get (Calendar.WEEK_OF_MONTH), p.size, buffer); break; case AM_PM_FIELD: buffer.setDefaultAttribute (DateFormat.Field.AM_PM); buffer.append (formatData.ampms[calendar.get (Calendar.AM_PM)]); break; case HOUR1_FIELD: // 1-12 buffer.setDefaultAttribute (DateFormat.Field.HOUR1); withLeadingZeros (((calendar.get (Calendar.HOUR) + 11) % 12) + 1, p.size, buffer); break; case HOUR0_FIELD: // 0-11 buffer.setDefaultAttribute (DateFormat.Field.HOUR0); withLeadingZeros (calendar.get (Calendar.HOUR), p.size, buffer); break; case TIMEZONE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.TIME_ZONE); TimeZone zone = calendar.getTimeZone(); boolean isDST = calendar.get (Calendar.DST_OFFSET) != 0; // FIXME: XXX: This should be a localized time zone. String zoneID = zone.getDisplayName (isDST, p.size > 3 ? TimeZone.LONG : TimeZone.SHORT); buffer.append (zoneID); break; default: throw new IllegalArgumentException ("Illegal pattern character " + p.field); } if (pos != null && (buffer.getDefaultAttribute() == pos.getFieldAttribute() || p.field == pos.getField())) { pos.setBeginIndex(beginIndex); pos.setEndIndex(buffer.length()); } } else { buffer.append(o.toString(), null); } } }
|
private void formatWithAttribute(Date date, FormatBuffer buffer, FieldPosition pos) { String temp; AttributedCharacterIterator.Attribute attribute; calendar.setTime(date); // go through vector, filling in fields where applicable, else toString Iterator iter = tokens.iterator(); while (iter.hasNext()) { Object o = iter.next(); if (o instanceof FieldSizePair) { FieldSizePair p = (FieldSizePair) o; int beginIndex = buffer.length(); switch (p.field) { case ERA_FIELD: buffer.append (formatData.eras[calendar.get (Calendar.ERA)], DateFormat.Field.ERA); break; case YEAR_FIELD: // If we have two digits, then we truncate. Otherwise, we // use the size of the pattern, and zero pad. buffer.setDefaultAttribute (DateFormat.Field.YEAR); if (p.size == 2) { temp = String.valueOf (calendar.get (Calendar.YEAR)); buffer.append (temp.substring (temp.length() - 2)); } else withLeadingZeros (calendar.get (Calendar.YEAR), p.size, buffer); break; case MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MONTH); if (p.size < 3) withLeadingZeros (calendar.get (Calendar.MONTH) + 1, p.size, buffer); else if (p.size < 4) buffer.append (formatData.shortMonths[calendar.get (Calendar.MONTH)]); else buffer.append (formatData.months[calendar.get (Calendar.MONTH)]); break; case DATE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_MONTH); withLeadingZeros (calendar.get (Calendar.DATE), p.size, buffer); break; case HOUR_OF_DAY1_FIELD: // 1-24 buffer.setDefaultAttribute(DateFormat.Field.HOUR_OF_DAY1); withLeadingZeros ( ((calendar.get (Calendar.HOUR_OF_DAY) + 23) % 24) + 1, p.size, buffer); break; case HOUR_OF_DAY0_FIELD: // 0-23 buffer.setDefaultAttribute (DateFormat.Field.HOUR_OF_DAY0); withLeadingZeros (calendar.get (Calendar.HOUR_OF_DAY), p.size, buffer); break; case MINUTE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MINUTE); withLeadingZeros (calendar.get (Calendar.MINUTE), p.size, buffer); break; case SECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.SECOND); withLeadingZeros(calendar.get (Calendar.SECOND), p.size, buffer); break; case MILLISECOND_FIELD: buffer.setDefaultAttribute (DateFormat.Field.MILLISECOND); withLeadingZeros (calendar.get (Calendar.MILLISECOND), p.size, buffer); break; case DAY_OF_WEEK_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK); if (p.size < 4) buffer.append (formatData.shortWeekdays[calendar.get (Calendar.DAY_OF_WEEK)]); else buffer.append (formatData.weekdays[calendar.get (Calendar.DAY_OF_WEEK)]); break; case DAY_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_YEAR); withLeadingZeros (calendar.get (Calendar.DAY_OF_YEAR), p.size, buffer); break; case DAY_OF_WEEK_IN_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK_IN_MONTH); withLeadingZeros (calendar.get (Calendar.DAY_OF_WEEK_IN_MONTH), p.size, buffer); break; case WEEK_OF_YEAR_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_YEAR); withLeadingZeros (calendar.get (Calendar.WEEK_OF_YEAR), p.size, buffer); break; case WEEK_OF_MONTH_FIELD: buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_MONTH); withLeadingZeros (calendar.get (Calendar.WEEK_OF_MONTH), p.size, buffer); break; case AM_PM_FIELD: buffer.setDefaultAttribute (DateFormat.Field.AM_PM); buffer.append (formatData.ampms[calendar.get (Calendar.AM_PM)]); break; case HOUR1_FIELD: // 1-12 buffer.setDefaultAttribute (DateFormat.Field.HOUR1); withLeadingZeros (((calendar.get (Calendar.HOUR) + 11) % 12) + 1, p.size, buffer); break; case HOUR0_FIELD: // 0-11 buffer.setDefaultAttribute (DateFormat.Field.HOUR0); withLeadingZeros (calendar.get (Calendar.HOUR), p.size, buffer); break; case TIMEZONE_FIELD: buffer.setDefaultAttribute (DateFormat.Field.TIME_ZONE); TimeZone zone = calendar.getTimeZone(); boolean isDST = calendar.get (Calendar.DST_OFFSET) != 0; // FIXME: XXX: This should be a localized time zone. String zoneID = zone.getDisplayName (isDST, p.size > 3 ? TimeZone.LONG : TimeZone.SHORT); buffer.append (zoneID); break; default: throw new IllegalArgumentException ("Illegal pattern character " + p.field); } if (pos != null && (buffer.getDefaultAttribute() == pos.getFieldAttribute() || p.field == pos.getField())) { pos.setBeginIndex(beginIndex); pos.setEndIndex(buffer.length()); } } else { buffer.append(o.toString(), null); } } }
| 11,417
|
public String toLocalizedPattern() { String localChars = formatData.getLocalPatternChars(); return applyLocalizedPattern (pattern, standardChars, localChars); }
|
public String toLocalizedPattern() { String localChars = formatData.getLocalPatternChars(); return translateLocalizedPattern(pattern, standardChars, localChars); }
| 11,419
|
public String toString() { StringBuffer output = new StringBuffer(); Iterator i = tokens.iterator(); while (i.hasNext()) { output.append(i.next().toString()); } return output.toString(); }
|
public String toString() { StringBuffer output = new StringBuffer(); Iterator i = tokens.iterator(); while (i.hasNext()) { output.append(i.next().toString()); } return output.toString(); }
| 11,420
|
void setParentImpl(View p) { if (p != null) { Component c = getComponent(); p.getContainer().add(c); } else { Component c = getComponent(); Container parent = c.getParent(); parent.remove(c); comp = null; } }
|
private void setParentImpl(View p) { if (p != null) { Component c = getComponent(); p.getContainer().add(c); } else { Component c = getComponent(); Container parent = c.getParent(); parent.remove(c); comp = null; } }
| 11,423
|
final Object getCompiledCode() { return compiledCode1; }
|
final Object getCompiledCode() { return compiledCode1; }
| 11,425
|
public int getNoExceptionHandlers() { return (eTable == null) ? 0 : eTable.length; }
|
public int getNoExceptionHandlers() { return (eTable == null) ? 0 : eTable.length; }
| 11,426
|
public int getSize() { return nativeCodeSize1; }
|
public int getSize() { return nativeCodeSize1; }
| 11,427
|
private void initialize() { sessions = new Sessions(); configs = new Vector(3); }
|
log.info("New session Manager initialized"); log.info("New session Manager initialized"); log.info("New session Manager initialized"); privatelog.info("New session Manager initialized"); voidlog.info("New session Manager initialized"); initialize()log.info("New session Manager initialized"); {log.info("New session Manager initialized"); log.info("New session Manager initialized"); log.info("New session Manager initialized"); log.info("New session Manager initialized"); log.info("New session Manager initialized"); log.info("New session Manager initialized"); sessionslog.info("New session Manager initialized"); =log.info("New session Manager initialized"); newlog.info("New session Manager initialized"); Sessions();log.info("New session Manager initialized"); log.info("New session Manager initialized"); log.info("New session Manager initialized"); log.info("New session Manager initialized"); log.info("New session Manager initialized"); log.info("New session Manager initialized"); configslog.info("New session Manager initialized"); =log.info("New session Manager initialized"); newlog.info("New session Manager initialized"); Vector(3);log.info("New session Manager initialized"); log.info("New session Manager initialized"); log.info("New session Manager initialized"); }
| 11,428
|
public boolean canImport (JComponent c, DataFlavor[] flavors) { return false; }
|
public boolean canImport(JComponent c, DataFlavor[] flavors) throws NotImplementedException { return false; }
| 11,429
|
public void exportAsDrag (JComponent c, InputEvent e, int action) { // TODO: Implement this properly }
|
public void exportAsDrag(JComponent c, InputEvent e, int action) throws NotImplementedException { // TODO: Implement this properly }
| 11,431
|
protected void exportDone (JComponent c, Transferable data, int action) { // TODO: Implement this properly }
|
protected void exportDone(JComponent c, Transferable data, int action) throws NotImplementedException { // TODO: Implement this properly }
| 11,432
|
public int getSourceActions (JComponent c) { return sourceActions; }
|
public int getSourceActions(JComponent c) { return sourceActions; }
| 11,434
|
public Icon getVisualRepresentation (Transferable t) { return visualRepresentation; }
|
public Icon getVisualRepresentation(Transferable t) { return visualRepresentation; }
| 11,435
|
public boolean importData (JComponent c, Transferable t) { return false; }
|
public boolean importData(JComponent c, Transferable t) throws NotImplementedException { return false; }
| 11,436
|
public Group addToGroup(Group groupObject) { if (groupObject != null) { if (groupMemberHash.add(groupObject)) { //add in successful groupObject.addMemberObject(this); return groupObject; // bad, should return based on success of adding } else { Log.error("Can't add to group. already a member of the group" + groupObject.getName()); return null; } } else { Log.error("Error: the group object to add to is null"); return null; } }
|
public Group addToGroup(Group groupObject) { if (groupObject != null) { if (groupMemberHash.add(groupObject)) { //add in successful groupObject.addMemberObject(this); return groupObject; // bad, should return based on success of adding } else { Log.error("Can't add to group. already a member of the group" + groupObject.getName()); return null; } } else { Log.error("Error: the group object to add to is null"); return null; } }
| 11,437
|
public Group addToGroup(Group groupObject) { if (groupObject != null) { if (groupMemberHash.add(groupObject)) { //add in successful groupObject.addMemberObject(this); return groupObject; // bad, should return based on success of adding } else { Log.error("Can't add to group. already a member of the group" + groupObject.getName()); return null; } } else { Log.error("Error: the group object to add to is null"); return null; } }
|
public Group addToGroup(Group groupObject) { if (groupObject != null) { if (groupMemberHash.add(groupObject)) { //add in successful groupObject.addMemberObject(this); return groupObject; // bad, should return based on success of adding } else { Log.error("Can't add to group. already a member of the group" + groupObject.getName()); return null; } } else { Log.error("Error: the group object to add to is null"); return null; } }
| 11,438
|
public Group addToGroup(Group groupObject) { if (groupObject != null) { if (groupMemberHash.add(groupObject)) { //add in successful groupObject.addMemberObject(this); return groupObject; // bad, should return based on success of adding } else { Log.error("Can't add to group. already a member of the group" + groupObject.getName()); return null; } } else { Log.error("Error: the group object to add to is null"); return null; } }
|
publicGroupaddToGroup(GroupgroupObject){if(groupObject!=null){if(groupMemberHash.add(groupObject)){//addinsuccessfulgroupObject.addMemberObject(this);returngroupObject;//bad,shouldreturnbasedonsuccessofadding}else{Log.error("Can'taddtogroup.alreadyamemberofthegroup"+groupObject.getName());returnnull;}}else{Log.error("Error:thegroupobjecttoaddtoisnull");returnnull;}}
| 11,439
|
protected Object clone () throws CloneNotSupportedException{ //shallow copy for fields BaseObject cloneObj = (BaseObject) super.clone(); // deep copy the attriOrder synchronized (this.attribOrder) { synchronized (cloneObj.attribOrder) { cloneObj.attribOrder = Collections.synchronizedList(new ArrayList()); int stop = this.attribOrder.size(); for (int i = 0; i < stop; i++) { cloneObj.attribOrder.add(new String((String) this.attribOrder.get(i))); } } } // XMLAttributes Clone, deep copy synchronized (this.attribHash) { synchronized (cloneObj.attribHash) { cloneObj.attribHash = new Hashtable(); Enumeration keys = this.attribHash.keys(); while (keys.hasMoreElements()) { String key = (String) keys.nextElement(); XMLAttribute XMLAttributeValue = (XMLAttribute) this.attribHash.get(key); cloneObj.attribHash.put(key, XMLAttributeValue.clone()); } } } return cloneObj; }
|
protected Object clone () throws CloneNotSupportedException{ //shallow copy for fields BaseObject cloneObj = (BaseObject) super.clone(); // deep copy the attriOrder synchronized (this.attribOrder) { synchronized (cloneObj.attribOrder) { cloneObj.attribOrder = Collections.synchronizedList(new ArrayList()); int stop = this.attribOrder.size(); for (int i = 0; i < stop; i++) { cloneObj.attribOrder.add(new String((String) this.attribOrder.get(i))); } } } // XMLAttributes Clone, deep copy synchronized (this.attribHash) { synchronized (cloneObj.attribHash) { cloneObj.attribHash = new Hashtable(); Enumeration keys = this.attribHash.keys(); while (keys.hasMoreElements()) { String key = (String) keys.nextElement(); XMLAttribute XMLAttributeValue = (XMLAttribute) this.attribHash.get(key); cloneObj.attribHash.put(key, XMLAttributeValue.clone()); } } } }
| 11,440
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.