final LookAndFeel lnf;
try{
- lnf = (LookAndFeel)( lnfClass.newInstance() );
+ lnf = (LookAndFeel) ( lnfClass.newInstance() );
}catch(InstantiationException e){
String warnMsg = MessageFormat.format(ERRFORM_LAF, className);
warnDialog(ERRTITLE_LAF, warnMsg, e);
Object selObj = path.getLastPathComponent();
if( selObj instanceof Land ){
- Land land = (Land)selObj;
+ Land land = (Land) selObj;
setFrameTitle(land.getLandDef().getLandName());
this.topView.showLandInfo(land);
this.actionManager.appearVillage(false);
this.actionManager.appearPeriod(false);
}else if( selObj instanceof Village ){
- final Village village = (Village)selObj;
+ final Village village = (Village) selObj;
Executor executor = Executors.newCachedThreadPool();
executor.execute(new Runnable(){
return land;
}
if(parent instanceof Land){
- Land land = (Land)parent;
+ Land land = (Land) parent;
List<VillageSection> sectionList = this.sectionMap.get(land);
int sectIndex = index;
if( ! this.ascending) sectIndex = sectionList.size() - index - 1;
return section;
}
if(parent instanceof VillageSection){
- VillageSection section = (VillageSection)parent;
+ VillageSection section = (VillageSection) parent;
int vilIndex = index;
if( ! this.ascending){
vilIndex = section.getVillageCount() - index - 1;
return getLandList().size();
}
if(parent instanceof Land){
- Land land = (Land)parent;
+ Land land = (Land) parent;
List<VillageSection> sectionList = this.sectionMap.get(land);
if(sectionList == null) return 0;
return sectionList.size();
}
if(parent instanceof VillageSection){
- VillageSection section = (VillageSection)parent;
+ VillageSection section = (VillageSection) parent;
return section.getVillageCount();
}
return 0;
return index;
}
if(parent instanceof Land){
- Land land = (Land)parent;
+ Land land = (Land) parent;
List<VillageSection> sectionList = this.sectionMap.get(land);
int index = sectionList.indexOf(child);
if( ! this.ascending) index = sectionList.size() - index - 1;
return index;
}
if(parent instanceof VillageSection){
- VillageSection section = (VillageSection)parent;
+ VillageSection section = (VillageSection) parent;
int index = section.getIndexOfVillage(child);
if( ! this.ascending){
index = section.getVillageCount() - index - 1;
String source;
value = object.getValue("source");
if(value instanceof JsString){
- source = ((JsString)value).toRawString();
+ source = ((JsString) value).toRawString();
}else{
source = "";
}
boolean isRegex;
value = object.getValue("isRegex");
if(value instanceof JsBoolean){
- isRegex = ((JsBoolean)value).booleanValue();
+ isRegex = ((JsBoolean) value).booleanValue();
}else{
isRegex = false;
}
int regexFlag = 0x00000000;
value = object.getValue("dotall");
if(value instanceof JsBoolean){
- if(((JsBoolean)value).isTrue()){
+ if(((JsBoolean) value).isTrue()){
regexFlag |= Pattern.DOTALL;
}
}
value = object.getValue("multiline");
if(value instanceof JsBoolean){
- if(((JsBoolean)value).isTrue()){
+ if(((JsBoolean) value).isTrue()){
regexFlag |= Pattern.MULTILINE;
}
}
value = object.getValue("ignorecase");
if(value instanceof JsBoolean){
- if(((JsBoolean)value).isTrue()){
+ if(((JsBoolean) value).isTrue()){
regexFlag |= IGNORECASEFLAG;
}
}
String comment;
value = object.getValue("comment");
if(value instanceof JsString){
- comment = ((JsString)value).toRawString();
+ comment = ((JsString) value).toRawString();
}else{
comment = "";
}
}
os = new BufferedOutputStream(os, BUFSIZ);
- Charset cs = (Charset)( encodeBox.getSelectedItem() );
+ Charset cs = (Charset) ( encodeBox.getSelectedItem() );
boolean hasIOError = false;
Writer writer = new OutputStreamWriter(os, cs);
int index = 0;
for(DataFlavor dataFlavor : URI_FLAVORS){
try{
- result[index++] = (DataFlavor)( dataFlavor.clone() );
+ result[index++] = (DataFlavor) ( dataFlavor.clone() );
}catch(CloneNotSupportedException e){
assert false;
throw new AssertionError(e);
*/
@Override
public void mousePressed(MouseEvent event){
- JComponent comp = (JComponent)event.getSource();
+ JComponent comp = (JComponent) event.getSource();
TransferHandler handler = comp.getTransferHandler();
handler.exportAsDrag(comp, event, TransferHandler.COPY);
return;
Topic topic;
if(row instanceof TalkDraw){
- topic = ((TalkDraw)row).getTalk();
+ topic = ((TalkDraw) row).getTalk();
}else if(row instanceof SysEventDraw){
- topic = ((SysEventDraw)row).getSysEvent();
+ topic = ((SysEventDraw) row).getSysEvent();
}else{
return false;
}
size = number.intValue();
}
- Font derivedFont = font.deriveFont(style, (float)size);
+ Font derivedFont = font.deriveFont(style, (float) size);
return derivedFont;
}
* デフォルトフォントとそれに適した描画属性が指定される。
*/
public FontInfo(){
- this((Font)null, (FontRenderContext)null);
+ this((Font) null, (FontRenderContext) null);
return;
}
private static final int DOCLIMIT = 100 * 1000; // 単位は文字
private static final float CHOPRATIO = 0.9f;
- private static final int CHOPPEDLEN = (int)(DOCLIMIT * CHOPRATIO);
+ private static final int CHOPPEDLEN = (int) (DOCLIMIT * CHOPRATIO);
static{
assert DOCLIMIT > CHOPPEDLEN;
public static String throughput(long size, long nano){
if(size <= 0 || nano <= 0) return "";
- double sec = ((double)nano) / (1000.0 * 1000.0 * 1000.0);
- double rate = ((double)size) / sec;
+ double sec = ((double) nano) / (1000.0 * 1000.0 * 1000.0);
+ double rate = ((double) size) / sec;
String unit = "";
if(rate >= 1500.0){
Component comp = editor.getEditorComponent();
GUIUtils.addMargin(comp, 1, 4, 1, 4);
if(comp instanceof JComponent){
- ((JComponent)comp).setComponentPopupMenu(new TextPopup());
+ ((JComponent) comp).setComponentPopupMenu(new TextPopup());
}
Monodizer.monodize(this.port);
String talks = talkCount + " 回";
double average;
- if(talkCount <= 0) average = 0.0;
- else average = (double)totalChars / (double)talkCount;
+ if(talkCount <= 0){
+ average = 0.0;
+ }else{
+ average = (double) totalChars / (double) talkCount;
+ }
String chars = AVERAGE_FORM.format(average) + " 文字";
Object[] row = {avatar, talks, chars, lastTime};
* @return 現在選択中のLand
*/
private Land getSelectedLand(){
- Land land = (Land)( this.landBox.getSelectedItem() );
+ Land land = (Land) ( this.landBox.getSelectedItem() );
return land;
}
*/
public static void updateTreeUI(Component comp, boolean isRoot) {
if(comp instanceof JComponent){
- JComponent jcomp = (JComponent)comp;
+ JComponent jcomp = (JComponent) comp;
jcomp.updateUI();
JPopupMenu popup = jcomp.getComponentPopupMenu();
}
if(comp instanceof JMenu){
- JMenu menu = (JMenu)comp;
+ JMenu menu = (JMenu) comp;
for(Component child : menu.getMenuComponents()){
updateTreeUI(child, false);
}
}else if(comp instanceof Container){
- Container cont = (Container)comp;
+ Container cont = (Container) comp;
for(Component child : cont.getComponents()){
updateTreeUI(child, false);
}