📄 multitextui.java
字号:
public int getAccessibleChildrenCount(JComponent c) { int result = 0; Iterator iterator = uis.iterator(); // first UI delegate provides the return value if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getAccessibleChildrenCount(c); } // return values from auxiliary UI delegates are ignored while (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); /* int ignored = */ ui.getAccessibleChildrenCount(c); } return result; } /** * Calls the {@link ComponentUI#getAccessibleChild(JComponent, int)} method * for all the UI delegates managed by this <code>MultiTextUI</code>, * returning the child for the UI delegate from the primary look and * feel. * * @param c the component * @param i the child index. * * @return The child returned by the UI delegate from the primary * look and feel. */ public Accessible getAccessibleChild(JComponent c, int i) { Accessible result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getAccessibleChild(c, i); } // return values from auxiliary UI delegates are ignored while (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); /* Accessible ignored = */ ui.getAccessibleChild(c, i); } return result; } /** * Calls the {@link TextUI#modelToView(JTextComponent, int)} method for all * the UI delegates managed by this <code>MultiTextUI</code>, * returning the bounds for the UI delegate from the primary look and * feel. * * @param tc the text component. * * @return The bounds returned by the UI delegate from the primary * look and feel. */ public Rectangle modelToView(JTextComponent tc, int pos) throws BadLocationException { Rectangle result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value if (iterator.hasNext()) { TextUI ui = (TextUI) iterator.next(); result = ui.modelToView(tc, pos); } // return values from auxiliary UI delegates are ignored while (iterator.hasNext()) { TextUI ui = (TextUI) iterator.next(); /* Rectangle ignored = */ ui.modelToView(tc, pos); } return result; } /** * Calls the {@link TextUI#modelToView(JTextComponent, int, Position.Bias)} * method for all the UI delegates managed by this <code>MultiTextUI</code>, * returning the bounds for the UI delegate from the primary look and * feel. * * @param tc the text component. * * @return The bounds returned by the UI delegate from the primary * look and feel. */ public Rectangle modelToView(JTextComponent tc, int pos, Bias bias) throws BadLocationException { Rectangle result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value if (iterator.hasNext()) { TextUI ui = (TextUI) iterator.next(); result = ui.modelToView(tc, pos, bias); } // return values from auxiliary UI delegates are ignored while (iterator.hasNext()) { TextUI ui = (TextUI) iterator.next(); /* Rectangle ignored = */ ui.modelToView(tc, pos, bias); } return result; } /** * Calls the {@link TextUI#viewToModel(JTextComponent, Point)} method for all * the UI delegates managed by this <code>MultiTextUI</code>, * returning the position for the UI delegate from the primary look and * feel. * * @param t the text component. * @param pt the point. * * @return The position returned by the UI delegate from the primary * look and feel. */ public int viewToModel(JTextComponent t, Point pt) { int result = 0; Iterator iterator = uis.iterator(); // first UI delegate provides the return value if (iterator.hasNext()) { TextUI ui = (TextUI) iterator.next(); result = ui.viewToModel(t, pt); } // return values from auxiliary UI delegates are ignored while (iterator.hasNext()) { TextUI ui = (TextUI) iterator.next(); /* int ignored = */ ui.viewToModel(t, pt); } return result; } /** * Calls the {@link TextUI#viewToModel(JTextComponent, Point, Bias[])} method * for all the UI delegates managed by this <code>MultiTextUI</code>, * returning the position for the UI delegate from the primary look and * feel. * * @param tc the text component. * * @return The position returned by the UI delegate from the primary * look and feel. */ public int viewToModel(JTextComponent tc, Point loc, Bias[] outBias) { int result = 0; Iterator iterator = uis.iterator(); // first UI delegate provides the return value if (iterator.hasNext()) { TextUI ui = (TextUI) iterator.next(); result = ui.viewToModel(tc, loc, outBias); } // return values from auxiliary UI delegates are ignored while (iterator.hasNext()) { TextUI ui = (TextUI) iterator.next(); /* int ignored = */ ui.viewToModel(tc, loc, outBias); } return result; } /** * Calls the {@link TextUI#getNextVisualPositionFrom(JTextComponent, int, * Position.Bias, int, Position.Bias[])} method for all * the UI delegates managed by this <code>MultiTextUI</code>, * returning the position for the UI delegate from the primary look and * feel. * * @param tc the text component. * * @return The position returned by the UI delegate from the primary * look and feel. */ public int getNextVisualPositionFrom(JTextComponent tc, int pos, Bias bias, int direction, Bias[] outBias) throws BadLocationException { int result = 0; Iterator iterator = uis.iterator(); // first UI delegate provides the return value if (iterator.hasNext()) { TextUI ui = (TextUI) iterator.next(); result = ui.getNextVisualPositionFrom(tc, pos, bias, direction, outBias); } // return values from auxiliary UI delegates are ignored while (iterator.hasNext()) { TextUI ui = (TextUI) iterator.next(); /* int ignored = */ ui.getNextVisualPositionFrom(tc, pos, bias, direction, outBias); } return result; } /** * Calls the {@link TextUI#damageRange(JTextComponent, int, int)} method for * all the UI delegates managed by this <code>MultiTextUI</code>. * * @param tc the component. * @param start the start position. * @param end the end position. */ public void damageRange(JTextComponent tc, int start, int end) { Iterator iterator = uis.iterator(); while (iterator.hasNext()) { TextUI ui = (TextUI) iterator.next(); ui.damageRange(tc, start, end); } } /** * Calls the {@link TextUI#damageRange(JTextComponent, int, int, * Position.Bias, Position.Bias)} method for all the UI delegates managed by * this <code>MultiTextUI</code>. * * @param tc the component. * @param start the start position. * @param end the end position. * @param startBias the start bias. * @param endBias the end bias. */ public void damageRange(JTextComponent tc, int start, int end, Bias startBias, Bias endBias) { Iterator iterator = uis.iterator(); while (iterator.hasNext()) { TextUI ui = (TextUI) iterator.next(); ui.damageRange(tc, start, end, startBias, endBias); } } /** * Calls the {@link TextUI#getEditorKit(JTextComponent)} method for all * the UI delegates managed by this <code>MultiTextUI</code>, * returning the editor kit for the UI delegate from the primary look and * feel. * * @param tc the text component. * * @return The editor kit returned by the UI delegate from the primary * look and feel. */ public EditorKit getEditorKit(JTextComponent tc) { EditorKit result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value if (iterator.hasNext()) { TextUI ui = (TextUI) iterator.next(); result = ui.getEditorKit(tc); } // return values from auxiliary UI delegates are ignored while (iterator.hasNext()) { TextUI ui = (TextUI) iterator.next(); /* EditorKit ignored = */ ui.getEditorKit(tc); } return result; } /** * Calls the {@link TextUI#getRootView(JTextComponent)} method for all * the UI delegates managed by this <code>MultiTextUI</code>, * returning the view for the UI delegate from the primary look and * feel. * * @param tc the text component. * * @return The view returned by the UI delegate from the primary * look and feel. */ public View getRootView(JTextComponent tc) { View result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value if (iterator.hasNext()) { TextUI ui = (TextUI) iterator.next(); result = ui.getRootView(tc); } // return values from auxiliary UI delegates are ignored while (iterator.hasNext()) { TextUI ui = (TextUI) iterator.next(); /* View ignored = */ ui.getRootView(tc); } return result; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -