OSDN Git Service

srcディレクトリとdocディレクトリを作成
[xdf/git-repos.git] / src / xdf-swing / src / main / java / jp / ac / aiit / xdf / component / swing / mappers / JPanelMapper.java
1 package jp.ac.aiit.xdf.component.swing.mappers;
2
3 import java.awt.FlowLayout;
4 import java.util.Map;
5
6 import javax.swing.JPanel;
7 import javax.swing.border.Border;
8
9 import jp.ac.aiit.xdf.component.swing.attribute.AttributeProcessingUnit;
10 import jp.ac.aiit.xdf.component.swing.attribute.CommonAttributeStore;
11 import jp.ac.aiit.xdf.component.swing.attribute.GetterAttributeProcessor;
12 import jp.ac.aiit.xdf.component.swing.attribute.SetterAttributeProcessor;
13 import jp.ac.aiit.xdf.component.swing.typeconvert.BorderConverter;
14 import jp.ac.aiit.xdf.core.action.EventHandler;
15
16 /**
17  * groupタグをSwingのJPanelにマッピングする
18  * 
19  * @author Shunichi Takagi
20  */
21 public class JPanelMapper extends SwingLayoutingComponentMapperTemplate {
22
23         @Override
24         protected Map<String, AttributeProcessingUnit> initProcessingUnits() {
25                 Map<String, AttributeProcessingUnit> result = CommonAttributeStore.commonAttributes(model);
26                 result.put("border", new AttributeProcessingUnit(new SetterAttributeProcessor("setBorder", Border.class), new GetterAttributeProcessor("getBorder"), new BorderConverter()));
27                 
28                 return result;
29         }
30         
31         @Override
32         protected Object newComponent() {
33                 JPanel p = new JPanel();
34                 p.setLayout(new FlowLayout());
35                 p.setOpaque(false);
36                 
37                 return p;
38         }
39
40         @Override
41         protected Map<String, EventHandler> intiProcessingAction() {
42                 // TODO Auto-generated method stub
43                 return null;
44         }
45         
46 }