id
stringlengths
36
36
text
stringlengths
1
1.25M
08dd6f5e-bef7-444a-919e-f737b51cee57
public static void main(String[] args) { new ExampleSub(); }
2c93ec72-47eb-4235-a1e3-01ecff1dfd37
public ExamplePub() { super("Publisher Example"); setBounds(100, 100, 300, 200); cl = new Spacebrew(this); cl.addPublish("a Boolean publisher", false); cl.connect(hostname, "mypublisher", "A simple pure Java publisher"); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); Container con = this.getContentPane(); con.add(pane); button.addMouseListener(this); pane.add(button); setVisible(true); }
3d09647a-1b65-4a13-be66-ec0e940554cc
@Override public void mousePressed(MouseEvent e) { cl.send("a Boolean publisher", true); }
2fb979ff-c461-4de9-ba0c-6f210ee524b7
@Override public void mouseReleased(MouseEvent e) { cl.send("a Boolean publisher", false); }
a1f62c3f-37f7-43fd-93b6-7efaee60fe3b
@Override public void mouseClicked(MouseEvent e) {}
8d34a480-8ad3-4106-b290-d5330f161396
@Override public void mouseEntered(MouseEvent e) {}
8034d7cf-3c23-4503-9759-26065892dea9
@Override public void mouseExited(MouseEvent e) {}
7b9ad645-f381-458b-b019-c0cc4811e6d4
public static void main(String[] args) { new ExamplePub(); }
d537c8f3-0ba8-460b-9ad9-2230a938c639
public FullExampleSub() { super("Subscriber Example"); setBounds(100, 100, 300, 200); cl = new Spacebrew(this); cl.addSubscribe("a Boolean subscriber", "boolean", "onBooleanReceive"); cl.addSubscribe("a range subscriber", "range", "onRangeReceive"); cl.addSubscribe("a string subscriber", "string", "onStringReceive"); cl.addSubscribe("a custom subscriber", "x,y", "onCustomReceive"); cl.connect(hostname, "myfullsubscriber", "A pure Java subscriber"); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); Container con = this.getContentPane(); con.add(pane); pane.add(label1); pane.add(label2); pane.add(label3); setVisible(true); }
b37ff8d9-a92c-4748-9ed9-482c1dbf30a4
public void onBooleanReceive(boolean value) { pane.setBackground(value ? Color.green : Color.lightGray); }
77c66d37-fd23-4793-9fc2-c12ad6f77947
public void onRangeReceive(int value) { label1.setText("" + value); }
cdb84fce-8709-4c47-acc4-fd6e46990119
public void onStringReceive(String value) { label2.setText(value); }
d00bdbfc-2ccd-4c6b-a9f9-0dcd5cd2de3c
public void onCustomReceive(String value) { label3.setText(value); }
42261cbc-1446-4ccf-91c7-1b586552ea41
public static void main(String[] args) { new FullExampleSub(); }
3a7d6277-d477-4fe0-aae0-f921af958445
public Item(Host host, String file){ this.setHost(host); this.setFile(file); }
08b53e06-8836-4101-881a-b6aedf4e22ec
public Item(Host host, String file, int portNo){ this.setHost(host); this.setFile(file); this.setPortNo(portNo); }
0e826463-fe14-4e9f-a851-4c09b532ca47
public Host getHost() { return host; }
ce19d95d-20cf-4315-9a2f-2d7bdcbc013d
public void setHost(Host host) { this.host = host; }
d5cb9465-5201-46f7-a168-d0cf4fae3104
public String getFile() { return file; }
a3e82abc-d02f-4f11-afad-6710ae8da8fe
public void setFile(String file) { this.file = file; }
3d39705c-829a-43e4-9361-206eaac21046
public String toString(){ return host.toString()+file; }
e9b65fbb-6df5-403d-95a0-427a38e8b705
public int getPortNo() { return portNo; }
ce66a0d6-f561-4d42-8ba1-68364b8ef2f8
public void setPortNo(int portNo) { this.portNo = portNo; }
0d44b2bf-40bf-47c0-bc05-bcc19c8e964e
public Host(String host){ this.host = host; }
9410c41f-f7a8-4e47-92f2-d5fa65842b70
public void setHost(String host){ this.host = host; }
f5e397e4-1565-454d-abfe-52536e9496af
public String toString(){ return this.host; }
4d9f83f5-f173-40da-8862-a36bfedec95c
public static void main(String [] args){ Item item = new Item(new Host("221.130.120.178"), "/info/cm/ah/serviceInfo.html", 8080); // Item item = new Item(new Link("www.baidu.com"), "/"); HTMLExtractor xmlextractor = new htmlparserExtractor(); Mana manager = new Mana(item, xmlextractor); manager.startDownload(); Map<Item, Page> map = manager.getMap(); Iterator<Entry<Item, Page>> it = map.entrySet().iterator(); while(it.hasNext()){ Entry<Item, Page> entry = it.next(); Page page = entry.getValue(); System.out.println(page.toString()); } manager.startExtract(); }
05cccb31-c562-4f35-a8a2-2c6a915525f9
public Mana(Item item, HTMLExtractor xmlextractor){ this.down = new Download(lq); lq.add(item); this.exetractor = new Extractor(map, extractedMap, lq, xmlextractor); }
6a13db49-c72c-4242-a0e1-8a64227ac8d6
public void startDownload(){ currentItem = lq.peek(); Page p = down.downOps(); map.put(this.currentItem, p); }
88b84db6-dd45-468b-8184-43410be6b4b1
public Map<Item, Page> getMap(){ return map; }
170b3e0e-8c8b-4976-8f75-9634a5916dfc
public void startExtract(){ this.exetractor.extractingOps(); }
befd12a9-a49c-473c-993f-796e2be1d517
public Download(Queue<Item> lq){ this.lq = lq; }
5b6dad0d-1cad-442f-857a-82ba61dcd0be
public Page downOps(){ String str = ""; try { getItemfromQueue(); conn(); str = download(); disconn(); } catch (UnknownHostException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } return new Page(str); }
550a58c2-598b-4d73-a350-3792912da49b
public Item getItemfromQueue(){ this.currentItem = lq.remove(); return currentItem; }
7b9819af-958a-4486-a9de-54c98dfae423
public Socket conn() throws UnknownHostException, IOException{ //create Socket so = new Socket(currentItem.getHost().toString(), currentItem.getPortNo()); out = new PrintWriter(new BufferedOutputStream(so.getOutputStream())); in = new BufferedReader(new InputStreamReader(so.getInputStream())); return so; }
ec1edb90-db7c-4340-a1a2-899f684da7a6
public String download(){ out.println("GET "+ currentItem.getFile() + " HTTP/1.0\r\n"); out.println("Accept:text/plaint, text/html, text/*, */*\r\n:w"); out.println("\r\n"); out.flush(); String str; try { while((str = in.readLine())!=null){ sb.append(str); // System.out.println(str); } } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } return sb.toString(); }
6db21ef4-e225-4a87-be0d-6867a9d05285
public boolean disconn(){ try { so.close(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); return false; } return true; }
d47d215f-9a37-4449-a5e7-fcb491e283e8
public htmlparserExtractor(){ this.htmlparser = new Parser(); }
fe871ed6-b19e-4258-a7cc-291ed1f9187d
@Override public Set<String> XMLextract(Page page) throws SAXException, IOException { // TODO Auto-generated method stub try { htmlparser.setEncoding("utf-8"); } catch (ParserException e) { // TODO Auto-generated catch block e.printStackTrace(); System.out.println("set encoding error!!"); } System.out.println(page.toString()); Pattern ptn = Pattern.compile("<html[\\s\\S]*>[\\s\\S]*</html>"); Matcher m = ptn.matcher(page.toString()); // if(!m.matches()){ // System.out.println("no matches!!!"); // return; // } m.find(); String str = m.group(); try { htmlparser.setInputHTML(str); } catch (ParserException e) { // TODO Auto-generated catch block e.printStackTrace(); System.out.println("set input html error!!"); } NodeFilter filter = new TagNameFilter("a"); NodeList nodelist = null; try { nodelist = htmlparser.extractAllNodesThatMatch(filter); } catch (ParserException e) { // TODO Auto-generated catch block e.printStackTrace(); } if(nodelist == null){ System.out.println("nodelist is null!!"); return null; } int length = nodelist.size(); System.out.println("%%%%%%%%%%%%%extraction results%%%%%%%%%%%%%%%%"); Set<String> uriset = new HashSet<String>(); System.out.println("adding!!"); for(int i = 0;i<length;i++){ System.out.println(nodelist.elementAt(i).toHtml()); LinkTag n = (LinkTag)nodelist.elementAt(i); uriset.add(n.getAttribute("href")); if(n.getAttribute("href") == ""){ continue; } System.out.println("href is:"+n.getAttribute("href")); } System.out.println("added!!"); return uriset; }
1ab30d35-a682-44f5-b7ae-b82e07d8f97f
public Set<String> XMLextract(Page page) throws SAXException, IOException;
bd266b21-c8d0-4155-bad9-7cd202a18526
public static void main(String [] args){ Matcher m; /* * test 1 m = RegexSet.PATTERN_RELATIVE.matcher("setprefs?sig=0_T5EPPqnKeXKRNBpSyMSYQJYmxoU%3D&hl=zh-TW&source=homepage"); if(m.matches())System.out.println("it matches!!"); */ /* * test PATTERN_EXT_ABS_WS_HOST and PATTERN_EXT_ABS_WS_FILE // String tmpuri = "http://www.baidu.com/link?url=DdOdpOaVYsCFZNWF_vqYKXrQiyGW-9U2BKHhXE9Kr9NcFC0KkVHnn9st2MfqdLzg5Vp22FrB7Nn-8bgndt6-xTUtLx3Hua9al6Btb3b007_&wd=windows%20dos%E5%91%BD%E4%BB%A4&ie=utf-8&tn=baiduad&f=12&oq=windows%20doc%E5%91%BD%E4%BB%A4&rsp=0&inputT=21337&bs=mv%20windows"; // String tmpuri = "http://sports.sina.com.cn/g/pl/2014-04-15/09447119919.shtml"; String tmpuri = "http://221.130.120.178:8088/self/self_logon.jsp"; m = Constants.RegexSet.PATTERN_ABSOLUTE_WS.matcher(tmpuri); if(m.matches()) System.out.println("it matches!"); String [] sa = Constants.RegexSet.PATTERN_EXT_ABS_WS_HOST.split(tmpuri); System.out.println("split host:"+sa[1]); sa = Constants.RegexSet.PATTERN_EXT_ABS_WS_FILE.split(tmpuri); System.out.println("split:"+sa[1]); */ /* * test PATTERN_EXT_REL_NENDS_DIR // String tmpuri = "/link?url=DdOdpOaVYsCFZNWF_vqYKXrQiyGW-9U2BKHhXE9Kr9NcFC0KkVHnn9st2MfqdLzg5Vp22FrB7Nn-8bgndt6-xTUtLx3Hua9al6Btb3b007_&wd=windows%20dos%E5%91%BD%E4%BB%A4&ie=utf-8&tn=baiduad&f=12&oq=windows%20doc%E5%91%BD%E4%BB%A4&rsp=0&inputT=21337&bs=mv%20windows"; String tmpuri = "/g/pl/2014-04-15/09447119919.shtml"; m = Constants.RegexSet.PATTERN_EXT_REL_NENDS_DIR.matcher(tmpuri); if(m.find()) System.out.println("ext dir:"+m.group()); */ /* * test PATTER_EXT_ABS_WS_PORT String tmpuri = "http://221.130.120.178:8088/self/self_logon.jsp"; String [] sa = Constants.RegexSet.PATTERN_EXT_ABS_WS_PORT.split(tmpuri); System.out.println(sa[1]); */ }
67fc60b9-7d1d-405f-816d-587520c9a1d7
public static Item getItem(Item srcItem, String uri){ int type = getURIType(uri); String [] sa; //absolute uri with scheme if(type == Constants.UriTypesCons.URI_TYPE_ABSOLUTE_WS){ sa = Constants.RegexSet.PATTERN_EXT_ABS_WS_HOST.split(uri); String host = sa[1]; sa = Constants.RegexSet.PATTERN_EXT_ABS_WS_FILE.split(uri); String file = "/"+sa[1]; sa = Constants.RegexSet.PATTERN_EXT_ABS_WS_PORT.split(uri); int port = Integer.parseInt(sa[1]); System.out.println("abs ws is host "+host+" file "+file+" port "+ port); if(host.equals(srcItem.getHost().toString())) return new Item(srcItem.getHost(), file); return new Item(new Host(host), file,port); } //absolute uri with no scheme else if(type == Constants.UriTypesCons.URI_TYPE_ABSOLUTE_NS){ return new Item(srcItem.getHost(), uri); } //relative uri else if(type == Constants.UriTypesCons.URI_TYPE_RELATIVE){ String currentDir = srcItem.getFile(); if(currentDir.endsWith("/")){ //end with slash return new Item(srcItem.getHost(), srcItem.getFile()+uri); }else { //end not end with slash Matcher m = Constants.RegexSet.PATTERN_EXT_REL_NENDS_DIR.matcher(srcItem.getFile()); m.find(); currentDir = m.group(); return new Item(srcItem.getHost(),currentDir+uri); } } // return new Item(new Host("221.130.120.178"), "/info/cm/ah/"+uri, 8080); return null; }
c2918cc5-cb03-48d1-ab5f-a935e60119b6
public static int getURIType(String uri){ Matcher m; m = Constants.RegexSet.PATTERN_ABSOLUTE_WS.matcher(uri); if(m.matches()){ System.out.println("match the absolute ws model"); return Constants.UriTypesCons.URI_TYPE_ABSOLUTE_WS; } m = Constants.RegexSet.PATTERN_ABSOLUTE_NS.matcher(uri); if(m.matches()){ System.out.println("match the absolute ns model"); return Constants.UriTypesCons.URI_TYPE_ABSOLUTE_NS; } m = Constants.RegexSet.PATTERN_RELATIVE.matcher(uri); if(m.matches()){ System.out.println("match the relative model"); System.out.println("relative module "+uri);; return Constants.UriTypesCons.URI_TYPE_RELATIVE; } return Constants.UriTypesCons.URI_TYPE_WRONG; }
be213439-6b86-4745-a0f6-386c0e595304
public Page(String page){ this.setPage(page); }
7bc911d7-66c5-40f4-afe2-930ca6f720eb
public String toString() { return page; }
7279b7b9-7a4f-45e5-b0e4-cec6141acc2b
public void setPage(String page) { this.page = page; }
b72eb282-94ee-48f3-91ec-c084dd000047
public void extracted(){ this.extracted = true; }
ee2b575b-e900-41de-8cd2-b64df4244e6e
public boolean isExtracted(){ return extracted; }
5190654a-b4d1-415c-b92d-79a4084af533
public Extractor(Map<Item, Page> map, Map<Item, Page> extractedMap, Queue<Item> lq, HTMLExtractor xmlextractor){ this.map = map; this.extractedMap = extractedMap; this.lq = lq; this.xmlextractor = xmlextractor; }
e1473863-405c-440a-8e55-01bf136e6130
public void extractingOps(){ if(map.isEmpty()) return; Iterator<Entry<Item, Page>> it = map.entrySet().iterator(); Entry<Item, Page> entry; Set<String> set = null; while(it.hasNext()){ entry = it.next(); try { set = xmlextractor.XMLextract(entry.getValue()); } catch (SAXException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } map.remove(entry.getKey()); extractedMap.put(entry.getKey(), entry.getValue()); Iterator<String> strit = set.iterator(); while(strit.hasNext()){ String uri = strit.next(); System.out.println("the uri in page is " +uri+" in item "+entry.getKey().toString()); //create items and enqueue Item i = URIOperations.getItem(entry.getKey(), uri); lq.add(i); } Iterator<Item> itit= lq.iterator(); System.out.println("this is the queue"); while(itit.hasNext()){ System.out.println(itit.next().toString()); } } }
91972063-606c-4695-80e8-e1bea8d41e3f
public void afterBeanDiscovery(@Observes AfterBeanDiscovery event, BeanManager manager) { event.addContext(new ViewContext()); }
2301ac81-353f-4328-896d-902378807fde
private Map<String, Object> getViewScope() { FacesContext fctx = FacesContext.getCurrentInstance(); UIViewRoot viewRoot = fctx.getViewRoot(); return viewRoot.getViewMap(); }
5703f7f8-6cf9-4182-8581-cd7c77d02451
public Class<? extends Annotation> getScope() { return ViewScoped.class; }
21dd7363-31cc-404e-8ac6-e117c48f7c35
public <T> T get(Contextual<T> contextual, CreationalContext<T> creationalContext) { T t = get(contextual); if (t == null) { // System.out.println("CREATE"); t = create(contextual, creationalContext); } return t; }
4a640e24-563a-4049-a5ef-6935a29ed43d
@SuppressWarnings("unchecked") public <T> T get(Contextual<T> contextual) { if (!ViewContext.isBean(contextual)) { throw new IllegalArgumentException(); } else { Bean<T> bean = (Bean<T>) contextual; return (T) getViewScope().get(bean.getName()); } }
70c8e8ab-7ddd-4ebb-94f2-167839a36335
public boolean isActive() { return true; }
ca1a4942-848b-4b82-9461-f186b32186df
private <T> T create(Contextual<T> contextual, CreationalContext<T> creationalContext) { Bean<T> bean = (Bean<T>) contextual; T t = bean.create(creationalContext); getViewScope().put(bean.getName(), t); return t; }
4cfb0223-fcc3-4f74-8f23-1f2bb699f710
public static <T> boolean isBean(Contextual<T> contextual) { if (contextual instanceof Bean) { return true; } return false; }
e84c17a4-e965-4813-998f-d080aeba0e5b
@SuppressWarnings("unchecked") @Override public Object getAsObject(FacesContext context, UIComponent component, String value) { Object obj = value; if (component instanceof UIInput) { Parameter<Object> parameter = (Parameter<Object>)((UIInput)component).getValue(); parameter.setValue(Faces.convert(value, Faces.getConverter(parameter.getType()))); obj = parameter; } return obj; }
b8be063f-ef5d-477f-81f6-ff75964f1120
@Override public String getAsString(FacesContext context, UIComponent component, Object value) { return value.toString(); }
865f2278-065a-4686-a754-7f63544d5ae1
@SuppressWarnings("unchecked") public static <T> Class<T> getGenericTypeArgument(final Class<?> clazz, final int idx) { final Type type = clazz.getGenericSuperclass(); ParameterizedType paramType; try { paramType = (ParameterizedType) type; } catch (ClassCastException cause) { return getGenericTypeArgument((Class<T>) type, idx); } return (Class<T>) paramType.getActualTypeArguments()[idx]; }
119d7c8c-258c-48bc-ad94-6af9d3618211
@SuppressWarnings("unchecked") public static <T> Class<T> getGenericTypeArgument(final Field field, final int idx) { final Type type = field.getGenericType(); final ParameterizedType paramType = (ParameterizedType) type; return (Class<T>) paramType.getActualTypeArguments()[idx]; }
7e0189e0-7e84-44be-a28f-5907537c2f9e
public static <T> Class<T> getGenericTypeArgument(final Member member, final int idx) { Class<T> result = null; if (member instanceof Field) { result = getGenericTypeArgument((Field) member, idx); } else if (member instanceof Method) { result = getGenericTypeArgument((Method) member, idx); } return result; }
c5a9494c-d40a-4399-aac9-fd418bf03c5b
@SuppressWarnings("unchecked") public static <T> Class<T> getGenericTypeArgument(final Method method, final int pos) { return (Class<T>) method.getGenericParameterTypes()[pos]; }
02d0e20d-12c7-4e8d-b68e-f8dd9d815891
@Inject public Parameter(InjectionPoint ip) { String key = ip.getAnnotated().getAnnotation(Param.class).value(); flashScope = "flash".equals(ip.getAnnotated().getAnnotation(Param.class).scope()); type = Reflections.getGenericTypeArgument(ip.getMember(), 0); if (key.isEmpty()) { this.key = ip.getMember().getName(); } else { this.key = key; } }
b1c32f57-6689-4380-a333-80b636050080
public void keep() { setValue(value); }
b450afa7-894e-4521-9a0d-d4494475a83b
public String getKey() { return key; }
5403ab88-9187-4c58-8456-655867aee132
@SuppressWarnings("unchecked") public T getValue() { String parameterValue = Faces.getRequest().getParameter(key); if (flashScope) { // Inicio Anterior // Flash flash = Faces.getFlash(); // if (flash.containsKey(key)) { // value = (T)flash.get(key); // flash.keep(key); // } // Fim anterior if (parameterValue != null) { Faces.putFlashMap(key, parameterValue, Faces.getConverter(type)); } value = (T) Faces.getFlashMap(key); } else { // Map<String, Object> viewMap = Faces.getViewMap(); // if (parameterValue != null) { // viewMap.put(key, Faces.convert(parameterValue, getConverter())); // } // // result = (T) viewMap.get(key); } return value; }
c936888f-ba7e-44fd-814d-d91707e0edef
public void setValue(T value) { this.value = value; if (flashScope) { Faces.putFlashMap(key, value); } }
42a4b18a-e131-4b94-bf91-648567575407
@Override public String toString() { if (value != null) { return value.toString(); } return ""; }
d1b9ebb1-a8d7-419b-8ebc-6382db0a2672
public Class<?> getType() { return type; }
4c691b50-ba50-4c14-9b45-12144e67b255
public static Object convert(final String value, final Converter converter) { Object result = null; if (!isEmpty(value)) { if (converter != null) { result = converter.getAsObject(getFacesContext(), getFacesContext().getViewRoot(), value); } else { result = new String(value); } } return result; }
55124a91-99eb-45ef-8d0e-5ade9deeecad
public static Converter getConverter(Class<?> targetClass) { Converter result; try { Application application = getFacesContext().getApplication(); result = application.createConverter(targetClass); } catch (Exception e) { result = null; } return result; }
b5a82736-07dc-42d3-b70d-612785e8eb38
public static HttpServletRequest getRequest() { return (HttpServletRequest) getFacesContext().getExternalContext().getRequest(); }
6492afe0-bce4-486f-8ceb-e95094996df2
public static Flash getFlash() { return getFacesContext().getExternalContext().getFlash(); }
d34a3bbf-4b24-47cd-aecc-7bca6e3ef7a3
public static void putFlashMap(String key, Object value) { Flash flash = Faces.getFlash(); flash.put(key, value); }
502a27d8-b508-4e36-bdd8-37293a9232c6
public static void putFlashMap(String key, String value, Converter converter) { Flash flash = Faces.getFlash(); flash.put(key, Faces.convert(value, converter)); }
b60bed51-bc23-4aed-9fe7-365bb84ad9a0
public static Object getFlashMap(String key) { Object value = null; Flash flash = Faces.getFlash(); if (flash.containsKey(key)) { value = flash.get(key); flash.keep(key); } return value; }
4a108a7b-c4ff-4d61-88ac-b50990725029
public static FacesContext getFacesContext() { return (FacesContext) FacesContext.getCurrentInstance(); }
af350ff6-43d6-40a4-861d-e9995c114012
public static boolean isEmpty(final String value) { return value == null || value.trim().isEmpty(); }
8c568cca-768d-4461-92c5-429a6dfd09a5
@Override public void mouseClicked(MouseEvent e) { // TODO Auto-generated method stub }
b012457e-3ee1-4b7f-9238-68b72384ad51
@Override public void mouseEntered(MouseEvent e) { // TODO Auto-generated method stub }
02b87703-56d7-4e25-b0dd-68e48cc39382
@Override public void mouseExited(MouseEvent e) { // TODO Auto-generated method stub }
bf121fcf-9b7c-4f79-a032-376496defd80
@Override public void mousePressed(MouseEvent e) { // TODO Auto-generated method stub }
0d2d7dba-ddc0-4024-af10-757723ff9165
@Override public void mouseReleased(MouseEvent e) { // TODO Auto-generated method stub }
f8fc6343-6b0c-471a-bc53-071e7b9ab170
@Override public void keyPressed(KeyEvent e) { // TODO Auto-generated method stub }
a6cc0f9e-52bd-405e-877c-1123563d7f4f
@Override public void keyReleased(KeyEvent e) { // TODO Auto-generated method stub }
7112ccad-7b0b-4573-870e-633b97e995a7
@Override public void keyTyped(KeyEvent e) { // TODO Auto-generated method stub }
b6182060-797b-4542-9b51-3c3ac5fbeebd
public Ship(){ }
a816ae39-6b45-426c-ba5e-e4e25392cc69
@Override public void run() { // TODO Auto-generated method stub JFrame jeu = new JFrame("Let's play motherfucker"); AireDeJeu aire = new AireDeJeu(); }
e9f5a8bf-55a5-48ff-bd79-474777c941d6
public void paintComponent(Graphics g){ Graphics2D font = (Graphics2D) g; }
123e3175-e963-466f-a711-a9da694675fd
void incrSpeed(){}
f0ada2d1-b709-47ad-b3ab-aa41b28d6949
void decrSpeed(){}
56512f82-7f53-436d-ae8d-f686a39523ab
void turnRight(){}
3dbdce91-9f0e-4263-ae33-06f2de7dc1dc
void turnLeft(){}
1c89c1be-0d90-4331-9c73-41e7f867de0d
Point centrer(){ return new Point(position.x - pict.getWidth(null)/2,position.y - pict.getHeight(null)/2); }
6d433ac3-3091-4fa8-b47f-05b5e41b9a1f
Point getPosition(){ return position; }
1789e661-2ed9-4b4a-9d01-b0ba7e1e6077
public Asteroid(){ vitesseAng = (int) (Math.random()-0.5)*10; }
2a28c6c1-089d-4458-a6a0-b370e63c437f
public BaseDao() { ParameterizedType pt = (ParameterizedType) this.getClass().getGenericSuperclass(); clazz = (Class<?>) pt.getActualTypeArguments()[0]; }
dcc51ec3-c232-40e5-a9b3-4f6ba9da3809
@Inject public void setSessionFactory(SessionFactory sessionFactory) { this.sessionFactory = sessionFactory; }