mc4j-cvs Mailing List for MC4J JMX Console (Page 7)
Brought to you by:
ghinkl
You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
(7) |
Apr
(135) |
May
(32) |
Jun
(34) |
Jul
|
Aug
|
Sep
(7) |
Oct
(139) |
Nov
(11) |
Dec
(5) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(34) |
Feb
(1) |
Mar
(12) |
Apr
|
May
(87) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(27) |
Nov
(49) |
Dec
(13) |
2006 |
Jan
|
Feb
|
Mar
|
Apr
(252) |
May
(16) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
|
Mar
(2) |
Apr
(2) |
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
(3) |
Oct
|
Nov
(1) |
Dec
|
2009 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
(1) |
Jun
(2) |
Jul
(15) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2010 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(3) |
Aug
(6) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
(1) |
Nov
|
Dec
|
From: Greg H. <gh...@us...> - 2006-04-12 19:14:15
|
Update of /cvsroot/mc4j/mc4j/application/dist/org/mc4j/console/Windows2/Modes/output In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20162/application/dist/org/mc4j/console/Windows2/Modes/output Added Files: output.wstcref Log Message: Merging EMS into head for the 2.0 release work --- NEW FILE: output.wstcref --- <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE tc-ref PUBLIC "-//NetBeans//DTD Top Component in Mode Properties 2.0//EN" "http://www.netbeans.org/dtds/tc-ref2_0.dtd"> <tc-ref version="2.0"> <module name="org.mc4j.console" spec="1.3" /> <tc-id id="output" /> <state opened="true" /> </tc-ref> |
From: Greg H. <gh...@us...> - 2006-04-12 19:14:15
|
Update of /cvsroot/mc4j/mc4j/src/org/mc4j/console/swing/editor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20162/src/org/mc4j/console/swing/editor Added Files: ButtonRenderer.java ButtonEditor.java Log Message: Merging EMS into head for the 2.0 release work --- NEW FILE: ButtonEditor.java --- /* * Copyright 2002-2004 Greg Hinkle * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.mc4j.console.swing.editor; import javax.swing.*; import java.awt.event.ActionListener; import java.awt.event.ActionEvent; import java.awt.*; /** * @author Greg Hinkle (gh...@us...), Feb 3, 2005 * @version $Revision: 1.2 $($Author: ghinkl $ / $Date: 2006/04/12 19:14:05 $) */ public class ButtonEditor extends DefaultCellEditor { protected JButton button; private String label; private boolean isPushed; public ButtonEditor(JCheckBox checkBox) { super(checkBox); button = new JButton(); button.setOpaque(true); button.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { fireEditingStopped(); } }); } public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { if (isSelected) { button.setForeground(table.getSelectionForeground()); button.setBackground(table.getSelectionBackground()); } else { button.setForeground(table.getForeground()); button.setBackground(table.getBackground()); } label = (value == null) ? "" : value.toString(); button.setText(label); isPushed = true; return button; } public Object getCellEditorValue() { if (isPushed) { // // JOptionPane.showMessageDialog(button, label + ": Ouch!"); // System.out.println(label + ": Ouch!"); } isPushed = false; return new String(label); } public boolean stopCellEditing() { isPushed = false; return super.stopCellEditing(); } protected void fireEditingStopped() { super.fireEditingStopped(); } } --- NEW FILE: ButtonRenderer.java --- /* * Copyright 2002-2004 Greg Hinkle * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.mc4j.console.swing.editor; import javax.swing.*; import javax.swing.table.TableCellRenderer; import java.awt.*; /** * @author Greg Hinkle (gh...@us...), Feb 3, 2005 * @version $Revision: 1.2 $($Author: ghinkl $ / $Date: 2006/04/12 19:14:05 $) */ public class ButtonRenderer extends JButton implements TableCellRenderer { public ButtonRenderer() { setOpaque(true); } public Component getTableCellRendererComponent( JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { if (isSelected) { setForeground(table.getSelectionForeground()); setBackground(table.getSelectionBackground()); } else { setForeground(table.getForeground()); setBackground(UIManager.getColor("Button.background")); } setText((value == null) ? "" : value.toString()); return this; } } |
From: Greg H. <gh...@us...> - 2006-04-12 19:14:13
|
Update of /cvsroot/mc4j/mc4j/dist/org/mc4j/console/Windows2/Modes/explorer In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20162/dist/org/mc4j/console/Windows2/Modes/explorer Removed Files: connectionexplorer.wstcref filesystems.wstcref_hidden Log Message: Merging EMS into head for the 2.0 release work --- connectionexplorer.wstcref DELETED --- --- filesystems.wstcref_hidden DELETED --- |
From: Greg H. <gh...@us...> - 2006-04-12 19:14:13
|
Update of /cvsroot/mc4j/mc4j/src/images In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20162/src/images Added Files: AnimatedLogoStoppedMC4J2_64.gif GraphElements.gif GraphSettings2.gif AnimatedLogoMC4J2_64.gif Log Message: Merging EMS into head for the 2.0 release work --- NEW FILE: GraphSettings2.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: AnimatedLogoMC4J2_64.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: GraphElements.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: AnimatedLogoStoppedMC4J2_64.gif --- (This appears to be a binary file; contents omitted.) |
Update of /cvsroot/mc4j/mc4j/application/dist/org/mc4j/console/Windows2/Components In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20162/application/dist/org/mc4j/console/Windows2/Components Added Files: monitorexplorer.settings welcomepanel.settings connectionexplorer.settings output.settings properties.settings Log Message: Merging EMS into head for the 2.0 release work --- NEW FILE: monitorexplorer.settings --- <?xml version="1.0"?> <!DOCTYPE settings PUBLIC "-//NetBeans//DTD Session settings 1.0//EN" "http://www.netbeans.org/dtds/sessionsettings-1_0.dtd"> <settings version="1.0"> <instanceof class="org.mc4j.console.ConnectionExplorer"/> <instanceof class="org.openide.windows.TopComponent"/> <instanceof class="javax.swing.JComponent"/> <instanceof class="java.awt.Component"/> <instanceof class="java.awt.Container"/> <instance class="org.mc4j.console.bean.attribute.watch.MonitorTopComponent" method="getInstance"/> </settings> --- NEW FILE: connectionexplorer.settings --- <?xml version="1.0"?> <!DOCTYPE settings PUBLIC "-//NetBeans//DTD Session settings 1.0//EN" "http://www.netbeans.org/dtds/sessionsettings-1_0.dtd"> <settings version="1.0"> <instanceof class="org.mc4j.console.ConnectionExplorer"/> <instanceof class="org.openide.windows.TopComponent"/> <instanceof class="javax.swing.JComponent"/> <instanceof class="java.awt.Component"/> <instanceof class="java.awt.Container"/> <instanceof class="org.openide.explorer.ExplorerManager$Provider"/> <instanceof class="org.openide.explorer.ExplorerPanel"/> <instance class="org.mc4j.console.ConnectionExplorer" method="getInstance"/> </settings> --- NEW FILE: output.settings --- <?xml version="1.0"?> <!DOCTYPE settings PUBLIC "-//NetBeans//DTD Session settings 1.0//EN" "http://www.netbeans.org/dtds/sessionsettings-1_0.dtd"> <settings version="1.0"> <instanceof class="org.openide.windows.TopComponent"/> <instanceof class="org.netbeans.core.output2.OutputWindow"/> <instance class="org.netbeans.core.output2.OutputWindow" method="getDefault"/> </settings> --- NEW FILE: welcomepanel.settings --- <?xml version="1.0"?> <!DOCTYPE settings PUBLIC "-//NetBeans//DTD Session settings 1.0//EN" "http://www.netbeans.org/dtds/sessionsettings-1_0.dtd"> <settings version="1.0"> <instanceof class="org.mc4j.console.welcome.WelcomeTopComponent"/> <instanceof class="org.openide.windows.TopComponent"/> <instanceof class="javax.swing.JComponent"/> <instanceof class="java.awt.Component"/> <instanceof class="java.awt.Container"/> <instance class="org.mc4j.console.welcome.WelcomeTopComponent" method="getInstance"/> </settings> --- NEW FILE: properties.settings --- <?xml version="1.0"?> <!DOCTYPE settings PUBLIC "-//NetBeans//DTD Session settings 1.0//EN" "http://www.netbeans.org/dtds/sessionsettings-1_0.dtd"> <settings version="1.0"> <instanceof class="org.openide.windows.TopComponent"/> <instanceof class="org.netbeans.core.NbSheet"/> <instance class="org.netbeans.core.NbSheet" method="getDefault"/> </settings> |
Update of /cvsroot/mc4j/mc4j/src/org/mc4j/console/swing/editor/xml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20162/src/org/mc4j/console/swing/editor/xml Added Files: JEditorTest.java EditorDocument.java XMLStyleTokens.java RETokenizer.java BasicMBean.xml StyleTokens.java Log Message: Merging EMS into head for the 2.0 release work --- NEW FILE: RETokenizer.java --- /* * Copyright 2002-2004 Greg Hinkle * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.mc4j.console.swing.editor.xml; import java.util.regex.Matcher; /** * @author Greg Hinkle (gh...@us...), Nov 16, 2004 * @version $Revision: 1.2 $($Author: ghinkl $ / $Date: 2006/04/12 19:14:04 $) */ public class RETokenizer { protected StyleTokens types; protected Matcher matcher; public RETokenizer(StyleTokens types, String text) { this.types = types; matcher = types.getMatcher(text); } /* protected Token getToken(int position) { for (int i = 0; i < types.getTokens().length; i++) { StyleTokens.StyleToken styleToken = types.getTokens()[i]; String tokenMatch = matcher.group(i); if (tokenMatch != null) { String type = styleToken.name; return new Token(tokenMatch, type, position); } } return null; }*/ protected Token getToken(int pos) { int count = types.getTokens().length; for (int i = 0; i < types.getTokens().length; i++) { StyleTokens.StyleToken styleToken = types.getTokens()[i]; String token = matcher.group(i+1); if (token != null) { String type = styleToken.name; return new Token(token, type, pos); } } return null; } public Token nextToken() { if (matcher.find()) { return getToken(matcher.start()); } return null; } public static class Token { public String token; public String type; protected int position; public Token(String token, String type, int getPosition) { this.token = token; this.type = type; this.position = getPosition; } public String getText() { return token; } public String getType() { return type; } public int getPosition() { return position; } public String toString() { return type + "(" + token + ", " + position + ')'; } } } --- NEW FILE: BasicMBean.xml --- <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE Dashboard PUBLIC "-//MC4J//DTD Dashboard 1.0//EN" "http://mc4j.sourceforge.net/Dashboard_1_0.dtd"> <!-- Document : BasicMBean.xml Created on : October 6, 2002, 10:01 PM Author : ghinkl Description: Displays the basic information of an MBean --> <Dashboard version="1.0" name="Basic MBean View"> <Description>Displays general information about any MBean in the system.</Description> <DashboardMatch type="Bean"> <BeanMatch id="BeanNode" type="Single"> <Condition type="BeanObjectNameCondition" filter=".*"/> </BeanMatch> </DashboardMatch> <LayoutManager type="java.awt.BorderLayout"/> <Content> <!-- *** The header section displays title and a refresh control *** --> <Component type="javax.swing.JPanel"> <Constraint type="BorderConstraints" direction="NORTH"/> <LayoutManager type="java.awt.BorderLayout"/> <Border type="javax.swing.border.EmptyBorder" top="(Literal)2" left="(Literal)5" bottom="(Literal)2" right="(Literal)5"/> <Content> <Component type="javax.swing.JPanel"> <Constraint type="BorderConstraints" direction="CENTER"/> <LayoutManager type="java.awt.BorderLayout"/> <Content> <Component type="javax.swing.JLabel" id="titleLable"> <Constraint type="BorderConstraints" direction="CENTER"/> <Attribute name="text" value="DashboardName"/> <Attribute name="font" value="(Literal)SansSerif bold 20"/> <Attribute name="foreground" value="(Literal)0x666666"/> </Component> <Component type="javax.swing.JTextArea"> <Constraint type="BorderConstraints" direction="SOUTH"/> <Attribute name="text" value="(Message)General information about {ObjectName}"/> <Attribute name="font" value="(Literal)DialogInput bold 14"/> <Attribute name="opaque" value="(Literal)false"/> <Attribute name="editable" value="(Literal)false"/> </Component> </Content> </Component> <Component type="org.mc4j.console.dashboard.components.RefreshControlComponent"> <Constraint type="BorderConstraints" direction="EAST"/> <Attribute name="refreshDelay" value="(Literal)30000"/> </Component> </Content> </Component> <!-- *** The main content is displayed within a scrollpane for easy viewing *** --> <Component type="javax.swing.JScrollPane"> <Constraint type="BorderConstraints" direction="CENTER"/> <Attribute name="background" value="(Literal)0xFFFFFF"/> <Content> <Component type="javax.swing.JPanel"> <Attribute name="background" value="(Literal)0xFFFFFF"/> <LayoutManager type="java.awt.BoxLayout" axis="Y_AXIS"/> <Content> <!-- *** A Section holder is an included component for providing hide-able parts *** --> <Component type="org.mc4j.console.swing.SectionHolder"> <Attribute name="title" value="(Literal)MBean Attributes"/> <Attribute name="background" value="(Literal)0xFFFFFF"/> <LayoutManager type="java.awt.BorderLayout"/> <Content> <!-- *** This component displays the attributes of an MBean *** --> <Component type="org.mc4j.console.dashboard.components.AttributeTreeTableExplorer"> <!-- *** Notice were setting the node that we matched above by name here *** --> <Attribute name="beanNode" value="BeanNode"/> <Constraint type="BorderConstraints" direction="CENTER"/> <Border type="javax.swing.border.LineBorder" color="(Literal)0x444444" thickness="(Literal)1"/> <Attribute name="background" value="(Literal)0xFFFFFF"/> <Attribute name="background" value="(Literal)0xFFFFFF"/> </Component> </Content> </Component> <Component type="org.mc4j.console.swing.SectionHolder"> <Attribute name="title" value="(Literal)MBean Operations"/> <Attribute name="background" value="(Literal)0xFFFFFF"/> <Content> <Component type="org.mc4j.console.dashboard.components.OperationListComponent"> <Attribute name="beanNode" value="BeanNode"/> <Attribute name="format" value="(Literal)FULL_FORMAT"/> </Component> </Content> </Component> <!-- <Component type="org.mc4j.console.dashboard.components.FillerComponent"> <Attribute name="type" value="(Literal)VERTICAL_GLUE_SHAPE"/> </Component> --> </Content> </Component> </Content> </Component> </Content> </Dashboard> --- NEW FILE: StyleTokens.java --- /* * Copyright 2002-2004 Greg Hinkle * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.mc4j.console.swing.editor.xml; import javax.swing.text.Style; import javax.swing.text.StyleConstants; import javax.swing.text.StyledDocument; import java.awt.*; import java.util.LinkedList; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * @author Greg Hinkle (gh...@us...), Nov 16, 2004 * @version $Revision: 1.2 $($Author: ghinkl $ / $Date: 2006/04/12 19:14:04 $) */ public class StyleTokens { protected LinkedList tokenList; public StyleTokens() { tokenList = new LinkedList(); } public void addTokenType(String name, String expression, Color color, boolean bold) { tokenList.add(new StyleToken(name, expression, color, bold)); } public StyleToken[] getTokens() { return (StyleToken[]) tokenList.toArray(new StyleToken[tokenList.size()]); } public void setStyles(StyledDocument doc) { for (int i = 0; i < tokenList.size(); i++) { StyleToken styleToken = (StyleToken) tokenList.get(i); Style style = doc.addStyle(styleToken.name,null); StyleConstants.setForeground(style,styleToken.color); StyleConstants.setBold(style, styleToken.bold); } // Add a special background colored, yellow // since I'm not sure how to do squiglies under text Style style = doc.addStyle("error",null); StyleConstants.setBackground(style, Color.yellow); } public String getExpression() { StringBuffer buffer = new StringBuffer(); for (int i = 0; i < tokenList.size(); i++) { StyleToken styleToken = (StyleToken) tokenList.get(i); if (i > 0) buffer.append('|'); buffer.append('('); buffer.append(styleToken.expression); buffer.append(')'); } return buffer.toString(); } public Pattern getPattern() { String expression = getExpression(); return Pattern.compile(expression, Pattern.MULTILINE); //Pattern.DOTALL); } public Matcher getMatcher(String text) { return getPattern().matcher(text); } public static class StyleToken { protected String name; protected String expression; protected Color color; protected boolean bold; public StyleToken(String name, String expr, Color color, boolean bold) { this.name = name; this.expression = expr; this.color = color; this.bold = bold; } } } --- NEW FILE: XMLStyleTokens.java --- /* * Copyright 2002-2004 Greg Hinkle * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.mc4j.console.swing.editor.xml; import javax.swing.text.Document; import javax.swing.text.StyledEditorKit; import java.awt.*; /** * @author Greg Hinkle (gh...@us...), Nov 16, 2004 * @version $Revision: 1.2 $($Author: ghinkl $ / $Date: 2006/04/12 19:14:04 $) */ public class XMLStyleTokens extends StyleTokens { public static final String TAG = "tag"; public static final String TEXT = "text"; public static final String COMMENT = "comment"; private static final String ATTRIBUTE = "attribute"; public XMLStyleTokens() { //"([^ >]*)=\"" // "<[^ >]* ([^ >])?" // "(\\w)+=\"?:[^\"]*\" addTokenType(COMMENT, "<!--[^--]*-->", Color.gray, false); addTokenType(TAG, "<[^ >]*|[\\?]?>", new Color(0,0,132), true); addTokenType(TEXT, "\"(?:\\\\.|[^\"\\\\])*\"", new Color(72,125,55), true); addTokenType(ATTRIBUTE, "\\w+(?<=)", Color.red, false); } public static class Kit extends StyledEditorKit { public Document createDefaultDocument() { return new EditorDocument(new XMLStyleTokens()); } } } --- NEW FILE: JEditorTest.java --- /* * Copyright 2002-2004 Greg Hinkle * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.mc4j.console.swing.editor.xml; /** * @author Greg Hinkle (gh...@us...), Nov 16, 2004 * @version $Revision: 1.2 $($Author: ghinkl $ / $Date: 2006/04/12 19:14:02 $) */ import javax.swing.*; import javax.swing.text.StyledEditorKit; import java.awt.*; import java.io.File; import java.io.FileReader; import java.io.IOException; public class JEditorTest extends JPanel { public JEditorTest(File file) throws IOException { //KeywordManager.loadKeywordFiles(); StyledEditorKit kit = null; if (file.getName().toLowerCase().endsWith(".xml")) { kit = new XMLStyleTokens.Kit(); } JEditorPane editor = new JEditorPane(); editor.setEditorKit(kit); editor.read(new FileReader(file), null); ((EditorDocument)editor.getDocument()).setValidating(true); setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4)); setLayout(new GridLayout()); add(new JScrollPane(editor)); } public static void main(String[] args) throws IOException { File file = new File("org/mc4j/console/swing/editor/xml/BasicMBean.xml"); JFrame frame = new JFrame("JEditor Test"); frame.getContentPane().setLayout(new BorderLayout()); frame.getContentPane().add(new JEditorTest(file),BorderLayout.CENTER); frame.setSize(700, 550); frame.setVisible(true); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); } } --- NEW FILE: EditorDocument.java --- /* * Copyright 2002-2004 Greg Hinkle * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.mc4j.console.swing.editor.xml; import org.w3c.dom.Document; import org.xml.sax.ErrorHandler; import org.xml.sax.SAXException; import org.xml.sax.SAXParseException; import javax.swing.text.AttributeSet; import javax.swing.text.BadLocationException; import javax.swing.text.DefaultStyledDocument; import javax.swing.text.Style; import javax.swing.text.StyleConstants; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import java.io.IOException; import java.io.InputStream; import java.io.StringBufferInputStream; /** * @author Greg Hinkle (gh...@us...), Nov 16, 2004 * @version $Revision: 1.2 $($Author: ghinkl $ / $Date: 2006/04/12 19:14:04 $) */ public class EditorDocument extends DefaultStyledDocument implements ErrorHandler { protected StyleTokens types; protected boolean validating = false; public EditorDocument(StyleTokens types) { Style defaultStyle = getStyle("default"); StyleConstants.setFontSize(defaultStyle, 12); StyleConstants.setFontFamily(defaultStyle, "Courier New"); Style tagStyle = addStyle("tag", defaultStyle); StyleConstants.setBold(tagStyle,true); this.types = types; types.setStyles(this); } public void insertString(int offset, String text, AttributeSet style) throws BadLocationException { super.insertString(offset, text, style); fireUpdate(); } public void remove(int offset, int length) throws BadLocationException { super.remove(offset, length); fireUpdate(); } private Thread updateThread = new Thread(new Runnable() { public void run() { while (true) { if (validating && needsUpdate) { needsUpdate = false; highlightSyntax(); validateSyntax(); } try { Thread.sleep(500); } catch (InterruptedException e) { e.printStackTrace(); } } } }); private boolean needsUpdate = false; public void fireUpdate() { needsUpdate = true; } public void warning(SAXParseException exception) throws SAXException { System.out.println(exception); highlightError(exception); } public void error(SAXParseException exception) throws SAXException { System.out.println(exception); highlightError(exception); } public void fatalError(SAXParseException exception) throws SAXException { System.out.println(exception); highlightError(exception); } public void validateSyntax() { long start = System.currentTimeMillis(); try { System.out.println("VALIDATING"); String text = getText(0, getLength()); InputStream s = new StringBufferInputStream(text); DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); // documentBuilderFactory.setValidating(true); DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); documentBuilder.setErrorHandler(this); Document doc = documentBuilder.parse(s); // System.out.println("VER: " + doc.getXmlVersion()); } catch (BadLocationException e) { // e.printStackTrace(); } catch (IOException e) { // e.printStackTrace(); } catch (ParserConfigurationException e) { // e.printStackTrace(); } catch (SAXException e) { // e.printStackTrace(); } finally { System.out.println("Validation took: " + (System.currentTimeMillis() - start) + "ms"); } } public void highlightError(SAXException se) { if (se instanceof SAXParseException) { try { String text = getText(0, getLength()); SAXParseException spe = (SAXParseException) se; int line = spe.getLineNumber(); int column = spe.getColumnNumber(); if (line < 1 || column < 1) return; String[] lines = text.split("\n"); int l = 0; for (int i=0;i<line-1;i++) { l += lines[i].length()+1; } int position = l + column; setCharacterAttributes(position,1,getStyle("error"),false); } catch (BadLocationException e) { e.printStackTrace(); } } } public void highlightSyntax() { try { String text = getText(0, getLength()); // Clear the existing styling setCharacterAttributes(0, getLength(), getStyle("default"), true); RETokenizer.Token token; RETokenizer tokenizer = new RETokenizer(types, text); while ((token = tokenizer.nextToken()) != null) { int pos = token.getPosition(); String type = token.getType(); String word = token.getText(); int len = word.length(); for (int i = 0; i < types.getTokens().length; i++) { StyleTokens.StyleToken styleToken = types.getTokens()[i]; String name = styleToken.name; if (type.equals(name)) { setCharacterAttributes(pos, len, getStyle(name), false); } } } } catch (Exception e) { e.printStackTrace(); } } public boolean isValidating() { return validating; } public void setValidating(boolean validating) { this.validating = validating; if (validating) { fireUpdate(); updateThread.start(); } } } |
Update of /cvsroot/mc4j/mc4j/lib/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20162/lib/common Added Files: jcommon-1.0.0.jar jfreechart-1.0.1.jar swingx.jar forms-1.0.5.jar zql.jar ognl-2.6.7.jar Removed Files: jfreechart-0.9.18.jar jdnc-0_6-all.jar jcommon-0.9.3.jar Log Message: Merging EMS into head for the 2.0 release work --- jfreechart-0.9.18.jar DELETED --- --- NEW FILE: jcommon-1.0.0.jar --- (This appears to be a binary file; contents omitted.) --- NEW FILE: swingx.jar --- (This appears to be a binary file; contents omitted.) --- NEW FILE: forms-1.0.5.jar --- (This appears to be a binary file; contents omitted.) --- NEW FILE: ognl-2.6.7.jar --- (This appears to be a binary file; contents omitted.) --- jcommon-0.9.3.jar DELETED --- --- jdnc-0_6-all.jar DELETED --- --- NEW FILE: zql.jar --- (This appears to be a binary file; contents omitted.) --- NEW FILE: jfreechart-1.0.1.jar --- (This appears to be a binary file; contents omitted.) |
From: Greg H. <gh...@us...> - 2006-04-12 19:14:12
|
Update of /cvsroot/mc4j/mc4j/dist/org/mc4j/console/Windows2/Modes/extras In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20162/dist/org/mc4j/console/Windows2/Modes/extras Removed Files: monitorexplorer.wstcref Log Message: Merging EMS into head for the 2.0 release work --- monitorexplorer.wstcref DELETED --- |
From: Greg H. <gh...@us...> - 2006-04-12 19:14:12
|
Update of /cvsroot/mc4j/mc4j/src/org/mc4j/console/connection/jboss In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20162/src/org/mc4j/console/connection/jboss Removed Files: ConnectorFinder.java JBossConnectorFinder.java Log Message: Merging EMS into head for the 2.0 release work --- JBossConnectorFinder.java DELETED --- --- ConnectorFinder.java DELETED --- |
From: Greg H. <gh...@us...> - 2006-04-12 19:14:11
|
Update of /cvsroot/mc4j/mc4j/application/dist/org/mc4j/console/Windows2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20162/application/dist/org/mc4j/console/Windows2 Added Files: WindowManager.wswmgr Log Message: Merging EMS into head for the 2.0 release work --- NEW FILE: WindowManager.wswmgr --- <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE windowmanager PUBLIC "-//NetBeans//DTD Window Manager Properties 2.1//EN" "http://www.netbeans.org/dtds/windowmanager-properties2_1.dtd"> <windowmanager version="2.1"> <!-- size and location of the main window --> <main-window> <joined-properties centered-vertically="true" centered-horizontally="true" relative-width="0.8" relative-height="0.8"/> </main-window> <editor-area state="joined" frame-state="0"> <constraints> <path orientation="vertical" number="20" weight="0.7" /> <path orientation="horizontal" number="20" weight="0.6" /> </constraints> </editor-area> <!-- size of the screen last displayed on --> <screen width="1024" height="768"/> <!-- reference to active mode --> <active-mode name="explorer"/> <!-- reference to maximized mode --> <!--<maximized-mode name="explorer"/>--> <!-- reference to toolbar configuration --> <toolbar configuration="Standard"/> </windowmanager> |
From: Greg H. <gh...@us...> - 2006-04-12 19:14:11
|
Update of /cvsroot/mc4j/mc4j/application/branding/bundle/org/netbeans/core/startup In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20162/application/branding/bundle/org/netbeans/core/startup Added Files: splash_mc4j.gif Bundle_mc4j.properties frame48_mc4j.gif Log Message: Merging EMS into head for the 2.0 release work --- NEW FILE: Bundle_mc4j.properties --- currentVersion=MC4J Management Console {0} SPLASH_HEIGHT=338 SPLASH_WIDTH=450 SplashProgressBarBounds=40,289,370,3 # 0,267,397,6 SplashProgressBarColor=0xB0B0B0 SplashRunningTextBounds=42,269,371,19 # 225,252,172,10 SplashRunningTextColor=0xB0B0B0 SplashRunningTextFontSize=12 --- NEW FILE: frame48_mc4j.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: splash_mc4j.gif --- (This appears to be a binary file; contents omitted.) |
From: Greg H. <gh...@us...> - 2006-04-12 19:14:11
|
Update of /cvsroot/mc4j/mc4j/src/org/mc4j/chires/components/flow In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20162/src/org/mc4j/chires/components/flow Added Files: FlowModelProfilerViewComponent.java ProfilerViewComponent.java ProfilerModel.java FlowModelTreeTableModel.java Log Message: Merging EMS into head for the 2.0 release work --- NEW FILE: FlowModelTreeTableModel.java --- /* * Copyright 2002-2004 Greg Hinkle * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.mc4j.chires.components.flow; import org.chires.model.history.flow.FlowEntryStats; import org.mc4j.console.swing.treetable.AbstractTreeTableModel; import org.mc4j.console.swing.treetable.TreeTableModel; import org.jfree.data.statistics.Statistics; import javax.management.j2ee.statistics.CountStatistic; import javax.management.j2ee.statistics.TimeStatistic; import javax.management.j2ee.statistics.Stats; import javax.management.j2ee.statistics.Statistic; import java.util.Arrays; /** * @author Greg Hinkle (gh...@us...), Nov 18, 2004 * @version $Revision: 1.2 $($Author: ghinkl $ / $Date: 2006/04/12 19:14:00 $) */ public class FlowModelTreeTableModel extends AbstractTreeTableModel { // Names of the columns. static protected String[] cNames = {"Name", "Calls", "Time", "Throws"}; static protected int[] cWidth = { 250, 40, 80, 40 }; // Types of the columns. static protected Class[] cTypes = { TreeTableModel.class, Long.class, String.class, String.class }; public FlowModelTreeTableModel(FlowEntryStats root) { super(root); } public void updateRoot(FlowEntryStats newRoot) { // TODO GH: Support the update of the stats (ugh) FlowEntryStats oldRoot = (FlowEntryStats) super.root; Statistic[] oldMethodStatistics = oldRoot.getStatistics(); Statistic[] newMethodStatistics = newRoot.getStatistics(); /*if (!Arrays.equals(oldMethodStatistics, newMethodStatistics)) { fireTreeNodesChanged(this,); }*/ super.root = newRoot; fireTreeStructureChanged(this, new Object[] { super.root }, null,null); } public Class getColumnClass(int column) { return cTypes[column]; } public int getColumnCount() { return cNames.length; } public String getColumnName(int column) { return cNames[column]; } public int getColumnWidth(int column) { return cWidth[column]; } public Object getValueAt(Object node, int column) { FlowEntryStats stat = (FlowEntryStats) node; Object value = null; TimeStatistic timeStatistic = (TimeStatistic) stat.getStatistic("Execution Time"); CountStatistic failureStatistic = (CountStatistic) stat.getStatistic("Execution Failures"); switch(column) { case 0: value = stat.toString(); break; case 1: value = new Long(timeStatistic.getCount()); break; case 2: value = getTime(timeStatistic.getTotalTime()); break; case 3: value = new Long(failureStatistic.getCount()); break; } return value; } public Object getChild(Object parent, int index) { FlowEntryStats stat = (FlowEntryStats) parent; FlowEntryStats[] children = stat.getFlowEntryStats(); if (children.length > index) return children[index]; return null; } public int getChildCount(Object parent) { FlowEntryStats stat = (FlowEntryStats) parent; FlowEntryStats[] children = stat.getFlowEntryStats(); return children!=null?children.length:0; } public String getTime(long ms) { long mins = ms / (1000*60); long secs = (ms - (mins * 1000 * 60)) / 1000; long millis = ms - (mins * 1000 * 60) - (secs * 1000); StringBuffer buf = new StringBuffer(); if (millis > 0) { buf.append(millis); buf.append(" ms"); } if (secs > 0) { if (buf.length() > 0) { buf.insert(0," "); } buf.insert(0, " secs"); buf.insert(0, secs); } if (mins > 0) { if (buf.length() > 0) { buf.insert(0," "); } buf.insert(0, " mins"); buf.insert(0, mins); } return buf.toString(); } } --- NEW FILE: ProfilerViewComponent.java --- /* * Copyright 2002-2004 Greg Hinkle * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.mc4j.chires.components.flow; import org.chires.model.history.flow.FlowEntryStats; import org.chires.model.history.flow.FlowStats; import org.chires.model.stack.BaseCallEntry; import org.mc4j.console.dashboard.components.BeanComponent; import org.mc4j.console.util.NodeUtil; import org.mc4j.ems.connection.bean.EmsBean; import org.mc4j.ems.connection.bean.attribute.EmsAttribute; import org.jdesktop.swing.decorator.HighlighterPipeline; import org.jdesktop.swing.decorator.Highlighter; import org.jdesktop.swing.decorator.HierarchicalColumnHighlighter; import org.jdesktop.swing.decorator.AlternateRowHighlighter; import org.jdesktop.jdnc.JNTreeTable; import javax.swing.*; import javax.swing.table.DefaultTableCellRenderer; import javax.management.j2ee.statistics.TimeStatistic; import java.awt.*; import java.util.Map; /** * @author Greg Hinkle (gh...@us...), Sep 14, 2004 * @version $Revision: 1.2 $($Author: ghinkl $ / $Date: 2006/04/12 19:14:00 $) */ public class ProfilerViewComponent extends JPanel implements BeanComponent { EmsBean emsBean; EmsAttribute statsAttribute; FlowStats stats; // private JScrollPane jScrollPane; // private JXTreeTable treeTable; private JNTreeTable treeTableView; private ProfilerModel treeTableModel; /** Creates new form ObjectFrame */ public ProfilerViewComponent() { // initComponents(); //this.setName("Flow Model Profiler"); } public static void main(String[] args) { ProfilerViewComponent view = new ProfilerViewComponent(); view.stats = new FlowStats(); BaseCallEntry a = new BaseCallEntry("A", "Class1", "method1"); BaseCallEntry b,c,d; b = new BaseCallEntry("A", "Class2", "method2"); b.addChildEntry(new BaseCallEntry("A","Class3","method4")); a.addChildEntry(b); a.addChildEntry(new BaseCallEntry("A","Class2", "method3")); view.stats.registerCallStack(a); view.stats.registerCallStack(new BaseCallEntry("A", "Class1", "method2")); view.stats.getFlowEntryStats()[0].registerCallStack(new BaseCallEntry("A","Class2","method3")); view.stats.getFlowEntryStats()[0].registerCallStack(new BaseCallEntry("A","Class2","method4")); view.loadTree(); JFrame frame = new JFrame(); frame.getContentPane().add(view); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSize(400,400); frame.setVisible(true); } public void setBean(EmsBean emsBean) { this.emsBean = emsBean; } public void setContext(Map context) { if (this.emsBean == null) { throw new IllegalStateException( "FlowModelProfilerViewComponent: attribute [emsBean] must be set with a Flow Model bean"); } statsAttribute = emsBean.getAttribute("stats"); retrieveData(); loadTree(); expandAll(); } private void retrieveData() { statsAttribute.refresh(); stats = (FlowStats) statsAttribute.getValue(); } public void refresh() { retrieveData(); treeTableModel.updateRoot(stats.getFlowEntryStats()[0]); repaint(); expandAll(); } private void expandAll() { treeTableView.expandAll(); } private void loadTree() { // TODO GH: Only loading the first child... not the root treeTableModel = new ProfilerModel(stats.getFlowEntryStats()[0]); this.treeTableView = new JNTreeTable(treeTableModel); this.treeTableView.setHasColumnControl(true); Highlighter alternateRowHighlighter = new AlternateRowHighlighter(); // Color fg = alternateRowHighlighter.getForeground(); // Color bg = alternateRowHighlighter.getBackground(); HierarchicalColumnHighlighter hierarchicalColumnHighlighter = new HierarchicalColumnHighlighter(/*fg, bg*/); HighlighterPipeline h = new HighlighterPipeline( new Highlighter[] { alternateRowHighlighter, hierarchicalColumnHighlighter}); this.treeTableView.setHighlighters(h); Icon icon = getIcon(); this.treeTableView.setOpenIcon(icon); // this.treeTableView.setClosedIcon(icon); // this.treeTableView.setCollapsedIcon(icon); // this.treeTableView.setLeafIcon(icon); this.treeTableView.getTreeTable().getColumnModel().getColumn(2).setCellRenderer(new TimeChartCellRenderer()); setLayout(new BorderLayout()); add(this.treeTableView,BorderLayout.CENTER); } public Icon getIcon() { return NodeUtil.getIcon("org/mc4j/console/mejb/img/Clock24.gif"); } public class TimeCellRenderer extends DefaultTableCellRenderer { public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); Long t = (Long) value; FlowEntryStats rootStats = (FlowEntryStats) treeTableModel.getRoot(); TimeStatistic totalTime = (TimeStatistic) rootStats.getStatistic("Execution Time"); double size = ((double)t.longValue()) / ((double)totalTime.getTotalTime()) ; setIcon(NodeUtil.scaleIcon("org/mc4j/console/mejb/img/Clock24.gif", size)); setHorizontalTextPosition(SwingConstants.LEFT); return this; } } public class TimeChartCellRenderer extends DefaultTableCellRenderer { TimeComponent timeComponent = new TimeComponent(); public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { //super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); Long t = (Long) value; FlowEntryStats rootStats = (FlowEntryStats) treeTableModel.getRoot(); TimeStatistic totalTime = (TimeStatistic) rootStats.getStatistic("Execution Time"); double size = ((double)t.longValue()) / ((double)totalTime.getTotalTime()) ; timeComponent.setGraphLength(size); return timeComponent; } public class TimeComponent extends JComponent { double percentage; public void setGraphLength(double percentage) { this.percentage = percentage; } protected void paintComponent(Graphics g) { int a = (int) (percentage * getWidth()); g.setColor(Color.green); g.fillRect(0,0,a,getHeight()); g.setColor(Color.blue); g.fillRect(a,0,getWidth()-a,getHeight()); } } } /*public static class TimeHighlighter extends Highlighter { protected Component doHighlight(Component component, ComponentAdapter componentAdapter) { return component; } }*/ // TODO GH: When JDNC supports custom treetable tree column editors, support variable clock size on node } --- NEW FILE: FlowModelProfilerViewComponent.java --- /* * Copyright 2002-2004 Greg Hinkle * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.mc4j.chires.components.flow; import org.chires.model.history.flow.FlowEntryStats; import org.chires.model.history.flow.FlowStats; import org.chires.model.stack.BaseCallEntry; import org.mc4j.console.dashboard.components.BeanComponent; import org.mc4j.console.swing.treetable.JTreeTable; import org.mc4j.ems.connection.bean.EmsBean; import org.mc4j.ems.connection.bean.attribute.EmsAttribute; import javax.swing.*; import javax.swing.table.TableColumn; import javax.swing.table.DefaultTableColumnModel; import javax.swing.tree.DefaultTreeCellRenderer; import javax.swing.tree.TreePath; import java.awt.*; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.util.Map; /** * @author Greg Hinkle (gh...@us...), Sep 14, 2004 * @version $Revision: 1.2 $($Author: ghinkl $ / $Date: 2006/04/12 19:14:00 $) */ public class FlowModelProfilerViewComponent extends JPanel implements BeanComponent { EmsBean emsBean; EmsAttribute statsAttribute; FlowStats stats; private javax.swing.JScrollPane jScrollPane; private JTreeTable treeTable; private FlowModelTreeTableModel treeTableModel; /** Creates new form ObjectFrame */ public FlowModelProfilerViewComponent() { initComponents(); //this.setName("Flow Model Profiler"); } public static void main(String[] args) { FlowModelProfilerViewComponent view = new FlowModelProfilerViewComponent(); view.stats = new FlowStats(); BaseCallEntry a = new BaseCallEntry("A", "Class1", "method1"); BaseCallEntry b,c,d; b = new BaseCallEntry("A", "Class2", "method2"); b.addChildEntry(new BaseCallEntry("A","Class3","method4")); a.addChildEntry(b); a.addChildEntry(new BaseCallEntry("A","Class2", "method3")); view.stats.registerCallStack(a); view.stats.registerCallStack(new BaseCallEntry("A", "Class1", "method2")); view.stats.getFlowEntryStats()[0].registerCallStack(new BaseCallEntry("A","Class2","method3")); view.stats.getFlowEntryStats()[0].registerCallStack(new BaseCallEntry("A","Class2","method4")); view.loadTree(); JFrame frame = new JFrame(); frame.getContentPane().add(view); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSize(400,400); frame.setVisible(true); } public void setBean(EmsBean emsBean) { this.emsBean = emsBean; } public void setContext(Map context) { if (this.emsBean == null) { throw new IllegalStateException( "FlowModelProfilerViewComponent: attribute [emsBean] must be set with a Flow Model bean"); } statsAttribute = emsBean.getAttribute("stats"); retrieveData(); loadTree(); expandAll(); } private void retrieveData() { statsAttribute.refresh(); stats = (FlowStats) statsAttribute.getValue(); } public void refresh() { retrieveData(); treeTableModel.updateRoot(stats.getFlowEntryStats()[0]); repaint(); expandAll(); } private void expandAll() { JTree tree = treeTable.getTree(); int count = tree.getRowCount(); for (int i=0;i<count;i++) { tree.expandRow(i); count = tree.getRowCount(); } } private void loadTree() { // TODO GH: Only loading the first child... not the root treeTableModel = new FlowModelTreeTableModel(stats.getFlowEntryStats()[0]); this.treeTable = new JTreeTable(treeTableModel); //this.tree = new JTree(treeTableModel); this.jScrollPane.setViewportView(treeTable); DefaultTableColumnModel cm = new DefaultTableColumnModel(); for (int i = 0; i < treeTableModel.getColumnCount();i++) { TableColumn column = new TableColumn(i,treeTableModel.getColumnWidth(i)); if (i>0) column.setPreferredWidth(treeTableModel.getColumnWidth(i)); column.setHeaderValue(treeTableModel.getColumnName(i)); cm.addColumn(column); } this.treeTable.setColumnModel(cm); //this.treeTable.getColumnModel().getColumn(0).setCellRenderer(new DefaultT); //this.treeTable.getTree().setCellRenderer(new DefaultTreeCellRenderer()); // this.treeTable.getTree().setCellRenderer(new CustomTreeTableCellRenderer()); // this.treeTable.getTree().setRootVisible(true); // this.treeTable.addMouseListener(new MouseHandler()); // this.treeTable.setRowHeight(22); this.jScrollPane.getComponent(0).setBackground(Color.white); this.jScrollPane.repaint(); } // private static Icon folderIcon = createImageIcon("images/FolderIcon.gif"); public class CustomTreeTableCellRenderer extends DefaultTreeCellRenderer { public Component getTreeCellRendererComponent(JTree tree, Object value, boolean sel, boolean expanded, boolean leaf, int row, boolean hasFocus) { super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, hasFocus); // TODO GH: Set icon return this; } } /** This method is called from within the constructor to * initialize the form. */ private void initComponents() { setLayout(new BorderLayout()); jScrollPane = new javax.swing.JScrollPane(); add(jScrollPane, BorderLayout.CENTER); } class MouseHandler extends MouseAdapter { public void mousePressed (MouseEvent e) { if (e.isPopupTrigger () && e.getClickCount () == 1) { doPopup (e.getX (), e.getY ()); } } public void mouseReleased(MouseEvent e) { if (e.isPopupTrigger () && e.getClickCount () == 1) { doPopup (e.getX (), e.getY ()); } } public void doPopup (int x, int y) { // Get the tree element under the mouse TreePath clickedElement = treeTable.getTree().getPathForLocation (x, y); // Update the selection if necessary updateSelection (clickedElement); // Display the name of the selected tree element in the selection field String clickedElementName; if (clickedElement != null) clickedElementName = clickedElement.getLastPathComponent ().toString (); else clickedElementName = "NONE"; //currentSelectionField.setText ("Display Popup for: " + clickedElementName); // Get the desired context menu and show it JPopupMenu contextMenu = retrieveContextMenu (clickedElement); contextMenu.show (treeTable, x, y); } private JPopupMenu retrieveContextMenu (TreePath clickedElement) { JPopupMenu contextMenu; if (clickedElement != null) contextMenu = retrieveElementContextMenu (clickedElement); else contextMenu = retrieveTreeContextMenu (); if (contextMenu != null) { // This is the code that attempts but fails to shrink the menu to fit the current commands // Make sure the size of the menu is uptodate with any chages made to its actions before display contextMenu.invalidate (); contextMenu.pack (); } return contextMenu; } private JPopupMenu retrieveElementContextMenu (TreePath clickedElement) { if (clickedElement == null) return null; final FlowEntryStats stats = (FlowEntryStats) clickedElement.getLastPathComponent(); JPopupMenu contextMenu = null; contextMenu = new JPopupMenu("Tree Actions"); /*if (!treeNode.isFolder()) { JMenuItem editItem = new JMenuItem("Edit configuration"); editItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { IOProvider.getDefault().getStdOut().println("Editing document: " + treeNode.getPath()); treeTableModel.loadConfigurationNode(treeNode); ConfigurationEditor ce = new ConfigurationEditor(treeNode.getConfig()); ce.open(); } }); contextMenu.add(editItem); } else { JMenuItem refreshItem = new JMenuItem("Refresh folder"); refreshItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { } }); contextMenu.add(refreshItem); }*/ return contextMenu; } private JPopupMenu retrieveTreeContextMenu () { JPopupMenu treeMenu = new JPopupMenu ("Tree Context Menu"); return treeMenu; } private void updateSelection (TreePath clickedElement) { // Find out if the clicked on element is already selected boolean clickedElementSelected = false; TreePath[] selection = treeTable.getTree().getSelectionPaths (); if (clickedElement != null && selection != null) { // Determine if it one of the selected paths for (int index = 0; index < selection.length; ++index) { if (clickedElement.equals (selection[index])) { clickedElementSelected = true; break; } } } // Select the clicked on element or clear all selections if (!clickedElementSelected) { if (clickedElement != null) { // Clicked on unselected item - make it the selection treeTable.getTree().setSelectionPath (clickedElement); } else { // clicked over nothing clear the selection treeTable.getTree().clearSelection (); } } } } } --- NEW FILE: ProfilerModel.java --- /* * Copyright 2002-2004 Greg Hinkle * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.mc4j.chires.components.flow; import org.chires.model.history.flow.FlowEntryStats; import org.chires.stat.ChiresTimeStatistic; import org.jfree.data.statistics.Statistics; import org.jdesktop.swing.treetable.AbstractTreeTableModel; import org.jdesktop.swing.treetable.TreeTableModel; import javax.management.j2ee.statistics.CountStatistic; import javax.management.j2ee.statistics.TimeStatistic; import javax.management.j2ee.statistics.Stats; import javax.management.j2ee.statistics.Statistic; import java.util.Arrays; import java.util.List; /** * @author Greg Hinkle (gh...@us...), Nov 18, 2004 * @version $Revision: 1.2 $($Author: ghinkl $ / $Date: 2006/04/12 19:14:00 $) */ public class ProfilerModel extends AbstractTreeTableModel { // Names of the columns. static protected String[] cNames = {"Name", "Calls", "Time (ms)", "Throws"}; static protected int[] cWidth = { 250, 40, 80, 40 }; // Types of the columns. static protected Class[] cTypes = { TreeTableModel.class, Long.class, Long.class, String.class }; public ProfilerModel(FlowEntryStats root) { super(root); } public void updateRoot(FlowEntryStats newRoot) { // TODO GH: Support the update of the stats (ugh) FlowEntryStats oldRoot = (FlowEntryStats) super.root; Statistic[] oldMethodStatistics = oldRoot.getStatistics(); Statistic[] newMethodStatistics = newRoot.getStatistics(); /*if (!Arrays.equals(oldMethodStatistics, newMethodStatistics)) { fireTreeNodesChanged(this,); }*/ super.root = newRoot; fireTreeStructureChanged(this, new Object[] { super.root }, null,null); } private void updateNode(FlowEntryStats oldStats, FlowEntryStats newStats) { if (!Arrays.equals(oldStats.getStatistics(),newStats.getStatistics())) { } FlowEntryStats[] oldChildren = oldStats.getFlowEntryStats(); FlowEntryStats[] newChildren = newStats.getFlowEntryStats(); for (int i = 0; i < oldChildren.length; i++) { if (oldChildren[i].getClassName() != newChildren[i].getClassName() || oldChildren[i].getMethodName() != newChildren[i].getMethodName()) { } } } public Class getColumnClass(int column) { return cTypes[column]; } public int getColumnCount() { return cNames.length; } public String getColumnName(int column) { return cNames[column]; } public int getColumnWidth(int column) { return cWidth[column]; } public Object getValueAt(Object node, int column) { FlowEntryStats stat = (FlowEntryStats) node; Object value = null; TimeStatistic timeStatistic = (TimeStatistic) stat.getStatistic("Execution Time"); CountStatistic failureStatistic = (CountStatistic) stat.getStatistic("Execution Failures"); switch(column) { case 0: value = stat.toString(); break; case 1: value = new Long(timeStatistic.getCount()); break; case 2: value = new Long(timeStatistic.getTotalTime()); break; case 3: value = new Long(failureStatistic.getCount()); break; } return value; } public void setValueAt(Object o, Object o1, int i) { } public Object getChild(Object parent, int index) { FlowEntryStats stat = (FlowEntryStats) parent; FlowEntryStats[] children = stat.getFlowEntryStats(); if (children.length > index) return children[index]; return null; } public int getChildCount(Object parent) { FlowEntryStats stat = (FlowEntryStats) parent; FlowEntryStats[] children = stat.getFlowEntryStats(); return children!=null?children.length:0; } public String getTime(long ms) { long mins = ms / (1000*60); long secs = (ms - (mins * 1000 * 60)) / 1000; long millis = ms - (mins * 1000 * 60) - (secs * 1000); StringBuffer buf = new StringBuffer(); if (millis > 0) { buf.append(millis); buf.append(" ms"); } if (secs > 0) { if (buf.length() > 0) { buf.insert(0," "); } buf.insert(0, " secs"); buf.insert(0, secs); } if (mins > 0) { if (buf.length() > 0) { buf.insert(0," "); } buf.insert(0, " mins"); buf.insert(0, mins); } return buf.toString(); } public static class CallInfoNode { long totalExecutionCount; long totalExecutionTime; long failureCount; String className; String methodName; List<CallInfoNode> callInfoNodes; public CallInfoNode(FlowEntryStats stats) { TimeStatistic timeStatistic = (TimeStatistic) stats.getStatistic("Execution Time"); CountStatistic failureStatistic = (CountStatistic) stats.getStatistic("Execution Failures"); ChiresTimeStatistic ts = new ChiresTimeStatistic(timeStatistic); } } } |
From: Greg H. <gh...@us...> - 2006-04-12 19:14:08
|
Update of /cvsroot/mc4j/mc4j/src/org/mc4j/console/dashboard/context In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20162/src/org/mc4j/console/dashboard/context Added Files: OgnlHelper.java Log Message: Merging EMS into head for the 2.0 release work --- NEW FILE: OgnlHelper.java --- /* * Copyright 2002-2005 Greg Hinkle * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.mc4j.console.dashboard.context; import ognl.ClassResolver; import ognl.DefaultClassResolver; import ognl.DefaultTypeConverter; import ognl.Ognl; import ognl.OgnlException; import ognl.OgnlRuntime; import ognl.PropertyAccessor; import ognl.TypeConverter; import org.mc4j.ems.connection.bean.EmsBean; import org.mc4j.ems.connection.bean.attribute.EmsAttribute; import org.openide.windows.IOProvider; import javax.management.openmbean.CompositeData; import javax.management.openmbean.TabularData; import java.awt.Color; import java.awt.Dimension; import java.awt.Font; import java.util.Map; import java.util.HashMap; import java.util.Date; /** * @author Greg Hinkle (gh...@us...), Apr 6, 2006 * @version $Revision: 1.2 $($Author: ghinkl $ / $Date: 2006/04/12 19:14:00 $) */ public class OgnlHelper { static TypeConverter converter = new ExtendedConvertor(); static ClassResolver resolver = new DefaultClassResolver(); static Formatter formatter = new Formatter(); public static Object getValue(String identifier, Map context, Class type) throws OgnlException { return getValue(identifier, context, context, type); } public static Object getValue(String identifier, Map context, Object root, Class type) throws OgnlException { if (context == null) { context = new HashMap(); } Ognl.setTypeConverter(context, converter); Ognl.setClassResolver(context, resolver); context.put("format",formatter); Object expression = Ognl.parseExpression(identifier); Object result = Ognl.getValue(expression, context, context, type); if (result == null) { // Looks like Ognl gets confused by classes loaded in other classloaders // Try again without asking for conversion result = Ognl.getValue(expression,context, root); } return result; } public static class Formatter { public String date(Number millis) { if (millis == null) return null; return (new Date(millis.longValue())).toString(); } private long[] millisTimes = { 1000L,60L,60L,24L,365L}; private String[] millisName = { "Second", "Minute", "Hour", "Day", "Year" }; public String timeMillis(Number time) { return time(time, millisTimes, millisName); } private long[] nanosTimes = { 1000000000L,60L,60L,24L,365L}; private String[] nanosName = {"Second", "Minute", "Hour", "Day", "Year" }; public String timeNanos(Number time) { return time(time, nanosTimes, nanosName); } private String time(Number time ,long[] spaces, String[] names) { long n = time.longValue(); long[] values = new long[spaces.length]; // Temporarily store the divisor in the values values[0] = spaces[0]; for (int i = 1;i<values.length;i++) values[i] = spaces[i] * values[i-1]; for (int i = values.length-1; i >=0; i--) { n -= values[i] * (values[i] = n / values[i]); } StringBuilder b = new StringBuilder(); for (int i = values.length-1; i >= 0; i--) { if (values[i] > 0) { if (b.length() > 0) b.append(" "); b.append(values[i]); b.append(" "); b.append(names[i]); if (values[i] > 1) b.append("s"); } } return b.toString(); } public String sizeBytes(Number bytes) { long l = (long) Math.log10(bytes.doubleValue()); if (l <3) { return String.format("%,.2f Bytes", bytes.doubleValue()); } else if (l < 6) { return String.format("%,.2f KB", bytes.doubleValue() / Math.pow(10d, 3d)); } else if (l < 9) { return String.format("%,.2f MB", bytes.doubleValue() / Math.pow(10d, 6d)); } else { return String.format("%,.2f GB", bytes.doubleValue() / Math.pow(10d, 9d)); } } } public static class ExtendedConvertor extends DefaultTypeConverter { public Object convertValue(Map context, Object value, Class toType) { Object result = null; if ((toType == Dimension.class) && (value instanceof String)) { String[] parts = ((String) value).split(","); result = new Dimension(Integer.parseInt(parts[0]), Integer.parseInt(parts[1])); } else if (toType == Color.class && (value instanceof String)) { result = Color.decode((String) value); } else if (toType == Font.class && (value instanceof String)) { result = Font.decode((String) value); } else { result = super.convertValue(context, value, toType); } return result; } } static { OgnlRuntime.setPropertyAccessor(EmsBean.class, new EmsBeansPropertyAccessor()); OgnlRuntime.setPropertyAccessor(CompositeData.class, new CompositePropertyAccessor()); OgnlRuntime.setPropertyAccessor(TabularData.class, new TabularDataPropertyAccessor()); } public static class EmsBeansPropertyAccessor implements PropertyAccessor { public Object getProperty(Map context, Object target, Object name) throws OgnlException { EmsBean bean = (EmsBean) target; EmsAttribute attribute = bean.getAttribute((String) name); if (attribute == null) { IOProvider.getDefault().getIO("Dashboard debugging", false).getOut(). println("Attribute [" + name + "] not found on bean [" + bean.getBeanName() + "]"); return "?"; } return attribute.getValue(); } public void setProperty(Map map, Object object, Object object1, Object object2) throws OgnlException { throw new UnsupportedOperationException("Don't set attribute this way."); } } public static class CompositePropertyAccessor implements PropertyAccessor { public Object getProperty(Map context, Object target, Object name) throws OgnlException { CompositeData d = (CompositeData) target; return d.get((String) name); } public void setProperty(Map map, Object object, Object object1, Object object2) throws OgnlException { throw new UnsupportedOperationException("Don't set attributes this way."); } } public static class TabularDataPropertyAccessor implements PropertyAccessor { public Object getProperty(Map context, Object target, Object name) throws OgnlException { TabularData d = (TabularData) target; return d.get(new Object[]{name}); } public void setProperty(Map map, Object object, Object object1, Object object2) throws OgnlException { } } /* public static void main(String[] args) { Map context = new HashMap(); context.put("foo", new Date()); //Object result = OgnlHelper.getValue("'500,300'", context, Dimension.class); Object result = OgnlHelper.getValue("new javax.swing.JPanel()", context, null); System.out.println("Type: " + result.getClass().getName()); System.out.println("Value: " + result); } */ } |
Update of /cvsroot/mc4j/mc4j/dist/org/mc4j/console/Windows2/Components In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20162/dist/org/mc4j/console/Windows2/Components Removed Files: connectionexplorer.settings monitorexplorer.settings properties.settings output.settings welcomepanel.settings Log Message: Merging EMS into head for the 2.0 release work --- monitorexplorer.settings DELETED --- --- connectionexplorer.settings DELETED --- --- output.settings DELETED --- --- welcomepanel.settings DELETED --- --- properties.settings DELETED --- |
From: Greg H. <gh...@us...> - 2006-04-12 19:14:08
|
Update of /cvsroot/mc4j/mc4j/application/dashboards/carbon In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20162/application/dashboards/carbon Removed Files: Carbon_ConfigurationTree.xml Carbon_ServerInfo.xml Carbon_MemoryInfo.xml Log Message: Merging EMS into head for the 2.0 release work --- Carbon_MemoryInfo.xml DELETED --- --- Carbon_ConfigurationTree.xml DELETED --- --- Carbon_ServerInfo.xml DELETED --- |
From: Greg H. <gh...@us...> - 2006-04-12 19:14:05
|
Update of /cvsroot/mc4j/mc4j/application/dist/org/mc4j/console/Windows2/Modes/extras In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20162/application/dist/org/mc4j/console/Windows2/Modes/extras Added Files: monitorexplorer.wstcref Log Message: Merging EMS into head for the 2.0 release work --- NEW FILE: monitorexplorer.wstcref --- <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE tc-ref PUBLIC "-//NetBeans//DTD Top Component in Mode Properties 2.0//EN" "http://www.netbeans.org/dtds/tc-ref2_0.dtd"> <tc-ref version="2.0"> <module name="org.mc4j.console" spec="1.3" /> <tc-id id="output" /> <state opened="true" /> </tc-ref> |
From: Greg H. <gh...@us...> - 2006-04-12 19:14:05
|
Update of /cvsroot/mc4j/mc4j/application/dist/org/mc4j/console/Windows2/Modes/explorer In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20162/application/dist/org/mc4j/console/Windows2/Modes/explorer Added Files: filesystems4.wstcref_hidden connectionexplorer.wstcref filesystems.wstcref_hidden Log Message: Merging EMS into head for the 2.0 release work --- NEW FILE: filesystems4.wstcref_hidden --- <?xml version="1.0" encoding="UTF-8"?> <tc-ref version="2.0"> <module name="org.netbeans.core.ui/1" spec="1.2" /> <tc-id id="filesystems" /> <state opened="true" /> </tc-ref> --- NEW FILE: connectionexplorer.wstcref --- <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE tc-ref PUBLIC "-//NetBeans//DTD Top Component in Mode Properties 2.0//EN" "http://www.netbeans.org/dtds/tc-ref2_0.dtd"> <tc-ref version="2.0"> <module name="org.mc4j.console" spec="1.3" /> <tc-id id="connectionexplorer" /> <state opened="true" /> </tc-ref> --- NEW FILE: filesystems.wstcref_hidden --- <?xml version="1.0" encoding="UTF-8"?> <tc-ref version="2.0"> <module name="org.netbeans.core.ui/1" spec="1.2" /> <tc-id id="filesystems" /> <state opened="true" /> </tc-ref> |
From: Greg H. <gh...@us...> - 2006-04-12 19:14:05
|
Update of /cvsroot/mc4j/mc4j/application/dist/org/mc4j/console/Windows2/Modes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20162/application/dist/org/mc4j/console/Windows2/Modes Added Files: extras.wsmode properties.wsmode editor.wsmode explorer.wsmode output.wsmode Log Message: Merging EMS into head for the 2.0 release work --- NEW FILE: explorer.wsmode --- <?xml version="1.0" encoding="UTF-8"?> <mode version="2.0"> <module name="org.mc4j.console" spec="1.3" /> <name unique="explorer" /> <kind type="view" /> <state type="joined" /> <constraints> <path orientation="vertical" number="20" weight="1" /> <path orientation="horizontal" number="0" weight="0.3" /> <path orientation="vertical" number="0" weight="0.7"/> </constraints> <bounds x="0" y="0" width="0" height="0" /> <frame state="0" /> <active-tc id="connectionexplorer" /> <empty-behavior permanent="false" /> </mode> <!-- <mode version="2.0"> <module name="org.netbeans.core.ui/1" spec="1.2" /> <name unique="explorer" /> <kind type="view" /> <state type="joined" /> <constraints> <path orientation="vertical" number="20" weight="0.7" /> <path orientation="horizontal" number="20" weight="0.2509124087591241" /> </constraints> <bounds x="140" y="183" width="280" height="510" /> <frame state="0" /> <active-tc id="connectionexplorer" /> <empty-behavior permanent="true" /> </mode> --> --- NEW FILE: output.wsmode --- <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mode PUBLIC "-//NetBeans//DTD Mode Properties 2.0//EN" "http://www.netbeans.org/dtds/mode-properties2_0.dtd"> <mode version="2.0"> <name unique="output" /> <kind type="view" /> <state type="joined" /> <constraints> <path orientation="vertical" number="40" weight="0.3" /> <path orientation="horizontal" number="20" weight="0.5" /> </constraints> <relative-bounds x="10" y="68" width="40" height="20" /> <active-tc id="output" /> <empty-behavior permanent="true" /> </mode> <!-- <?xml version="1.0" encoding="UTF-8"?> <mode version="2.0"> <name unique="output"/> <kind type="view"/> <state type="joined"/> <constraints> <path orientation="vertical" number="20" weight="0.7" /> <path orientation="horizontal" number="20" weight="0.7" /> <path orientation="vertical" number="1" weight="0.25" /> </constraints> <bounds x="0" y="0" width="0" height="0"/> <frame state="0"/> <empty-behavior permanent="false"/> </mode> <mode version="2.0"> <name unique="output" /> <kind type="view" /> <state type="joined" /> <constraints> <path orientation="horizontal" number="1" weight="0.7436131386861313" /> <path orientation="vertical" number="40" weight="0.3" /> <path orientation="horizontal" number="20" weight="0.5" /> </constraints> <bounds x="140" y="693" width="560" height="204" /> <frame state="0" /> <empty-behavior permanent="true" /> </mode> --> --- NEW FILE: extras.wsmode --- <?xml version="1.0" encoding="UTF-8"?> <mode version="2.0"> <name unique="extras" /> <kind type="view" /> <state type="joined" /> <constraints> <path orientation="vertical" number="20" weight="0.7"/> <path orientation="horizontal" number="20" weight="0.7"/> <path orientation="vertical" number="1" weight="0.25"/> </constraints> <bounds x="0" y="0" width="0" height="0" /> <frame state="0" /> <active-tc id="monitorexplorer" /> <empty-behavior permanent="true" /> </mode> --- NEW FILE: properties.wsmode --- <?xml version="1.0" encoding="UTF-8"?> <mode version="2.0"> <name unique="properties" /> <kind type="view" /> <state type="joined" /> <constraints> <path orientation="vertical" number="20" weight="1" /> <path orientation="horizontal" number="0" weight="0.3" /> <path orientation="vertical" number="1" weight="0.3"/> </constraints> <bounds x="0" y="0" width="0" height="0" /> <frame state="0" /> <active-tc id="properties" /> <empty-behavior permanent="false" /> </mode> <!-- <mode version="2.0"> <name unique="properties" /> <kind type="view" /> <state type="joined" /> <constraints> <path orientation="horizontal" number="1" weight="0.7436131386861313" /> <path orientation="vertical" number="20" weight="0.7" /> <path orientation="horizontal" number="60" weight="0.3192032156487688" /> <path orientation="vertical" number="60" weight="0.5" /> </constraints> <bounds x="1050" y="438" width="210" height="255" /> <frame state="0" /> <active-tc id="properties" /> <empty-behavior permanent="true" /> </mode> --> --- NEW FILE: editor.wsmode --- <?xml version="1.0" encoding="UTF-8"?> <mode version="2.0"> <module name="org.mc4j.console" spec="1.3" /> <name unique="editor" /> <kind type="editor" /> <state type="joined" /> <bounds x="0" y="0" width="0" height="0" /> <frame state="0" /> <!--<active-tc id="welcomepanel" />--> <empty-behavior permanent="true" /> </mode> |
From: Greg H. <gh...@us...> - 2006-04-12 19:14:04
|
Update of /cvsroot/mc4j/mc4j/dist/org/mc4j/console/Windows2/Modes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20162/dist/org/mc4j/console/Windows2/Modes Removed Files: explorer.wsmode extras.wsmode properties.wsmode editor.wsmode output.wsmode Log Message: Merging EMS into head for the 2.0 release work --- explorer.wsmode DELETED --- --- output.wsmode DELETED --- --- extras.wsmode DELETED --- --- properties.wsmode DELETED --- --- editor.wsmode DELETED --- |
Update of /cvsroot/mc4j/mc4j/src/org/mc4j/console/connection/install In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20162/src/org/mc4j/console/connection/install Removed Files: Weblogic9ConnectionTypeDescriptor.java Tomcat55ConnectionTypeDescriptor.java WebsphereStudioConnectionTypeDescriptor.java JBossConnectionTypeDescriptor.java WebsphereConnectionTypeDescriptor.java AbstractConnectionTypeDescriptor.java PramatiConnectionTypeDescriptor.java J2SE5ConnectionTypeDescriptor.java SJSASConnectionTypeDescriptor.java JSR160ConnectionTypeDescriptor.java ConnectionTypeDescriptor.java GeronimoConnectionTypeDescriptor.java JDMKConnectionTypeDescriptor.java Mx4jConnectionTypeDescriptor.java Oc4jConnectionTypeDescriptor.java Weblogic9Jsr77ConnectionTypeDescriptor.java WeblogicConnectionTypeDescriptor.java Log Message: Merging EMS into head for the 2.0 release work --- JSR160ConnectionTypeDescriptor.java DELETED --- --- Weblogic9Jsr77ConnectionTypeDescriptor.java DELETED --- --- PramatiConnectionTypeDescriptor.java DELETED --- --- WebsphereConnectionTypeDescriptor.java DELETED --- --- GeronimoConnectionTypeDescriptor.java DELETED --- --- J2SE5ConnectionTypeDescriptor.java DELETED --- --- Weblogic9ConnectionTypeDescriptor.java DELETED --- --- Mx4jConnectionTypeDescriptor.java DELETED --- --- JDMKConnectionTypeDescriptor.java DELETED --- --- JBossConnectionTypeDescriptor.java DELETED --- --- AbstractConnectionTypeDescriptor.java DELETED --- --- WeblogicConnectionTypeDescriptor.java DELETED --- --- ConnectionTypeDescriptor.java DELETED --- --- Tomcat55ConnectionTypeDescriptor.java DELETED --- --- WebsphereStudioConnectionTypeDescriptor.java DELETED --- --- Oc4jConnectionTypeDescriptor.java DELETED --- --- SJSASConnectionTypeDescriptor.java DELETED --- |
From: Greg H. <gh...@us...> - 2006-04-12 19:14:04
|
Update of /cvsroot/mc4j/mc4j/dist/org/mc4j/console/Windows2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20162/dist/org/mc4j/console/Windows2 Removed Files: WindowManager.wswmgr Log Message: Merging EMS into head for the 2.0 release work --- WindowManager.wswmgr DELETED --- |
From: Greg H. <gh...@us...> - 2006-04-12 19:14:03
|
Update of /cvsroot/mc4j/mc4j/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20162/lib Removed Files: regexp.jar Log Message: Merging EMS into head for the 2.0 release work --- regexp.jar DELETED --- |
From: Greg H. <gh...@us...> - 2006-04-12 19:14:03
|
Update of /cvsroot/mc4j/mc4j/src/org/mc4j/chires/components In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20162/src/org/mc4j/chires/components Added Files: JDBCQueryTableComponent.java Log Message: Merging EMS into head for the 2.0 release work --- NEW FILE: JDBCQueryTableComponent.java --- /* * Copyright 2002-2004 Greg Hinkle * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.mc4j.chires.components; import org.chires.model.history.jdbc.JDBCQueryStats; import org.chires.model.history.jdbc.JDBCStats; import org.mc4j.console.dashboard.components.BeanComponent; import org.mc4j.console.dashboard.components.RefreshControlComponent; import org.mc4j.console.swing.table.TableSorter; import org.mc4j.ems.connection.bean.EmsBean; import org.mc4j.ems.connection.bean.attribute.EmsAttribute; import org.jdesktop.swingx.JXTable; import org.jdesktop.swingx.decorator.AlternateRowHighlighter; import org.jdesktop.swingx.decorator.HighlighterPipeline; import org.jdesktop.swingx.decorator.Highlighter; import javax.management.j2ee.statistics.TimeStatistic; import javax.swing.*; import javax.swing.table.DefaultTableCellRenderer; import javax.swing.table.DefaultTableModel; import javax.swing.table.JTableHeader; import javax.swing.table.TableCellRenderer; import javax.swing.table.TableModel; import java.awt.*; import java.util.Arrays; import java.util.Map; import java.io.ByteArrayInputStream; /** * @author Greg Hinkle (gh...@us...), Sep 14, 2004 * @version $Revision: 1.2 $($Author: ghinkl $ / $Date: 2006/04/12 19:13:52 $) */ public class JDBCQueryTableComponent extends JPanel implements BeanComponent { EmsBean emsBean; EmsAttribute statsAttribute; JDBCStats stats; private static String SQL_KEYWORD_STRING = "CREATE:TABLE:IF:NOT:HAVING:EXISTS:DEFAULT:NULL:INDEX_NONE:BIT:REAL:CHAR:TEXT" + ":FLOAT:STRING:GROUP BY:INTEGER:VARCHAR:PRIMARY:FOREIGN:ROLLBACK:KEY:UNIQUE" + ":TIME:ALTER:ADD:DROP:NUMERIC:VIEW:INSERT:INTO:VALUES:SET:DELETE:FROM:WHERE" + ":UPDATE:SELECT:LIMIT:ORDER BY:JOIN:AS:ASC:DESC:COMMIT:LIKE:OR:AND"; private static String[] SQL_KEYS = SQL_KEYWORD_STRING.split(":"); public void setBean(EmsBean emsBean) { this.emsBean = emsBean; statsAttribute = emsBean.getAttribute("stats"); stats = (JDBCStats) statsAttribute.getValue(); } protected String label = ""; protected JScrollPane scrollPane; protected JXTable table; // protected TableSorter tableSorter; protected StatsTableModel tableModel; protected boolean sorted = false; private static final Font NAME_FONT = Font.decode("Arial-BOLD-12"); private static final Font VALUE_FONT = Font.decode("Arial-PLAIN-12"); protected long maxAvgTotalTime; public void init() { this.removeAll(); this.setMinimumSize(null); this.setPreferredSize(null); //this.setBorder(new TitledBorder(this.label)); this.setLayout(new BorderLayout()); this.setOpaque(false); Object[] columnNames = new String[] { "Statement", "Type", "Calls", "Failures", "Average Rows", "Time" }; this.tableModel = new StatsTableModel(columnNames, stats.getQueryStats().length); // this.tableSorter = new TableSorter(this.tableModel); this.table = new JXTable(this.tableModel); this.table.setColumnControlVisible(true); // TODO GH: FIXME - Only shows when there is a vertical scroll bar this.scrollPane = new JScrollPane(this.table); this.table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); this.table.setHighlighters(new HighlighterPipeline(new Highlighter[] {new AlternateRowHighlighter()})); this.table.setFont(VALUE_FONT); for (int i = 0; i < columnNames.length; i++) { this.table.getColumnModel().getColumn(i).setHeaderRenderer(new SortHeaderRenderer()); this.table.getColumnModel().getColumn(i).setCellRenderer(new ChangeRenderer()); } this.table.getColumnModel().getColumn(0).setPreferredWidth(260); this.table.getColumnModel().getColumn(5).setCellRenderer(new BarRenderer()); this.table.getColumnModel().getColumn(5).setPreferredWidth(260); this.table.setIntercellSpacing(new Dimension(2,2)); add(scrollPane, BorderLayout.CENTER); // The first refresh sets column classes properly refresh(); // iterate over the column classes and proxy them to a highlighting renderer this.doLayout(); this.repaint(); //Thread refresher = new Thread(this, "AttributeTableRefresher"); //refresher.start(); } public void refresh() { if (this.tableModel instanceof StatsTableModel) ((StatsTableModel)this.tableModel).resetChangeList(); maxAvgTotalTime = 0; statsAttribute.refresh(); stats = (JDBCStats) statsAttribute.getValue(); JDBCQueryStats[] queryStats = this.stats.getQueryStats(); for (int i = 0; i < queryStats.length; i++) { JDBCQueryStats queryStat = queryStats[i]; // "Statement", // "Type", // "Calls", // "Failures", // "Time" this.tableModel.setColumnClass(0,String.class); this.tableModel.setColumnClass(1,String.class); this.tableModel.setColumnClass(2,Long.TYPE); this.tableModel.setColumnClass(3,Long.TYPE); this.tableModel.setColumnClass(4, Long.TYPE); this.tableModel.setColumnClass(5,JDBCQueryStats.class); this.tableModel.setValueAt(queryStat.getStatement(), i, 0); this.tableModel.setValueAt(queryStat.getStatementType(), i, 1); this.tableModel.setValueAt(new Long(queryStat.getExecutionTime().getCount()), i, 2); this.tableModel.setValueAt(new Long(queryStat.getFailureCount().getCount()), i, 3); this.tableModel.setValueAt(new Long(queryStat.getRowCounts().getAverageCount()), i, 4); this.tableModel.setValueAt(queryStat, i, 5); long time = calculateAverageTotalTime(queryStat); if (maxAvgTotalTime < time) { maxAvgTotalTime = time; } } if (!this.sorted) this.sorted = true; this.tableModel.fireTableDataChanged(); } private long calculateAverageTotalTime(JDBCQueryStats queryStat) { long time = calculateAveragePrepTime(queryStat); time += calculateAverageExecTime(queryStat); time += calculateAverageRetTime(queryStat); return time; } private long calculateAverageRetTime(JDBCQueryStats queryStat) { TimeStatistic t; t = queryStat.getRetrievalTime(); if (t.getCount() > 0) return t.getTotalTime() / t.getCount(); return 0; } private long calculateAverageExecTime(JDBCQueryStats queryStat) { TimeStatistic t; t = queryStat.getExecutionTime(); if (t.getCount() > 0) return t.getTotalTime() / t.getCount(); return 0; } private long calculateAveragePrepTime(JDBCQueryStats queryStat) { TimeStatistic t = queryStat.getPreparationTime(); if (t.getCount() > 0) return t.getTotalTime() / t.getCount(); return 0; } public void run() { // Its a hack, but sleep until the component is likely to be showing try { Thread.sleep(2000); } catch(Exception e) { } while(this.isShowing()) { refresh(); try { Thread.sleep(1000); } catch(Exception e) { } } } public class StatsTableModel extends DefaultTableModel { Class[] columnClass = new Class[20]; boolean[][] changes; public StatsTableModel(Object[] columnNames, int rowCount) { super(columnNames, rowCount); reallocateIndexes(); } public void setColumnClass(int column, Class columnClass) { this.columnClass[column] = columnClass; } public boolean isCellEditable(int row, int column) { return false; } public Class getColumnClass(int columnIndex) { Class colClass = columnClass[columnIndex]; if (colClass == null) return Object.class; else return colClass; } public void setValueAt(Object aValue, int aRow, int aColumn) { Object obj = super.getValueAt(aRow, aColumn); if ((obj == null) || (obj != null && !obj.equals(aValue))) { super.setValueAt(aValue, aRow, aColumn); changes[aRow][aColumn] = true; } } public boolean isValueAtChanged(int row, int column) { return changes[row][column]; } public void resetChangeList() { for (int i = 0; i < changes.length; i++) { boolean[] change = changes[i]; for (int j = 0; j < change.length; j++) { change[j] = false; } } } public void reallocateIndexes() { int rowCount = getRowCount(); int colCount = getColumnCount(); // Set up a new array of indexes with the right number of elements // for the new data model. changes = new boolean[rowCount][colCount]; } /** * Adapts the internal changes array and then calls {@link DefaultTableModel#removeRow(int)}. */ public void removeRow(int row) { int rowCount = getRowCount(); int columnCount = getColumnCount(); boolean[][] newChanges = new boolean[rowCount-1][columnCount]; if ( 0 < row ) { System.arraycopy(this.changes, 0, newChanges, 0, row); } if ( (row + 1) < rowCount ) { System.arraycopy(this.changes, row+1, newChanges, row, rowCount-row-1); } changes = newChanges; super.removeRow(row); } /** * Adapts the internal changes array and then calls {@link DefaultTableModel#setRowCount(int)}. */ public void incrementRowCount() { int rowCount = getRowCount(); int columnCount = getColumnCount(); boolean[][] newChanges = new boolean[rowCount+1][columnCount]; System.arraycopy(this.changes, 0, newChanges, 0, rowCount); Arrays.fill(newChanges[rowCount], true); this.changes = newChanges; super.setRowCount(rowCount+1); } } public void setContext(Map context) { init(); } /** Getter for property label. * @return Value of property label. * */ public String getLabel() { return label; } /** Setter for property label. * @param label New value of property label. * */ public void setLabel(String label) { this.label = label; } public static class SortHeaderRenderer extends DefaultTableCellRenderer { private static Icon ascendingIcon = createImageIcon("images/Up.gif"); private static Icon descendingIcon = createImageIcon("images/Down.gif"); /** Returns an ImageIcon, or null if the path was invalid. */ protected static ImageIcon createImageIcon(String path) { java.net.URL imgURL = RefreshControlComponent.class.getClassLoader().getResource(path); if (imgURL != null) { return new ImageIcon(imgURL); } else { System.err.println("Couldn't find file: " + path); return null; } } public SortHeaderRenderer() { setHorizontalTextPosition(LEFT); setHorizontalAlignment(CENTER); } public Component getTableCellRendererComponent( JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int col) { int index = -1; boolean ascending = true; TableModel model = table.getModel(); if (model instanceof TableSorter) { index = ((TableSorter)model).getCurrentSortColumn(); ascending = ((TableSorter)model).isAscending(); } if (table != null) { JTableHeader header = table.getTableHeader(); if (header != null) { setForeground(header.getForeground()); setBackground(header.getBackground()); setFont(header.getFont()); } } setFont(getFont().deriveFont((index == col)?Font.BOLD:Font.PLAIN)); if (index == col) { setIcon(ascending?ascendingIcon:descendingIcon); } else { setIcon(null); } setText((value == null) ? "" :value.toString()); setBorder(UIManager.getBorder("TableHeader.cellBorder")); return this; } } public class BarRenderer implements TableCellRenderer{ public final Color PREP_COLOR = Color.decode("0xFFFF99"); public final Color EXEC_COLOR = Color.decode("0x0099CC"); public final Color RET_COLOR = Color.decode("0x66FF99"); public Component getTableCellRendererComponent( JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { if (value instanceof JDBCQueryStats) { final JDBCQueryStats stats = (JDBCQueryStats) value; final Rectangle size = table.getCellRect(row, column, false); long avgTotal = calculateAverageTotalTime(stats); final int width = size.width - 2; final int height = size.height - 2; if (maxAvgTotalTime == 0) maxAvgTotalTime = 1; final int prepWidth = (int) ((width * calculateAveragePrepTime(stats))/maxAvgTotalTime); final int execWidth = (int) ((width * calculateAverageExecTime(stats))/maxAvgTotalTime); final int retWidth = (int) ((width * calculateAverageRetTime(stats))/maxAvgTotalTime); JComponent c = new JLabel() { public final Color PREP_COLOR = Color.decode("0xFFFF99"); public final Color EXEC_COLOR = Color.decode("0x66CCFF"); public final Color RET_COLOR = Color.decode("0x66FF99"); { setOpaque(false); setBorder(BorderFactory.createEmptyBorder(2,2,2,2)); } public void paintComponent(Graphics g) { g.setColor(PREP_COLOR); g.fillRect(0,0,prepWidth,height); g.setColor(EXEC_COLOR); g.fillRect( prepWidth,0,execWidth,height); g.setColor(RET_COLOR); g.fillRect(prepWidth+execWidth,0,retWidth,height); setText(String.valueOf(calculateAverageTotalTime(stats))); super.paintComponent(g); } public Dimension getSize() { return new Dimension(size.width, size.height); } }; return c; } return new JLabel(); } } /** * A hack for some lightweight sql stylization. Just bolds the keywords and adds some * newlines if necessary. * TODO: Get/build a Stylized EditorKit for SQL * @param sql */ public static String stylize(String sql) { StringBuffer buf = new StringBuffer("<html>" + sql + "</html>"); boolean lb = sql.indexOf('\n') >=0; for (String key:SQL_KEYS) { int index = 0; index = buf.toString().toUpperCase().indexOf(key,index); if (index == -1) continue; // Only use it if its the entire word... (don't match desc to my_description) if (Character.isLetter(buf.charAt(index + key.length())) || Character.isLetter(buf.charAt(index - 1))) continue; if (!lb) { buf.insert(index, "\n"); buf.insert(index,"<b>"); buf.insert(index+4+key.length(),"</b>"); index +=8; } else { buf.insert(index,"<b>"); buf.insert(index+3+key.length(),"</b>"); index +=7; } } return buf.toString().replace("\n","<br>"); } public static class ChangeRenderer extends DefaultTableCellRenderer implements TableCellRenderer { public Component getTableCellRendererComponent( JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { JComponent comp = (JComponent) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); if (column == 0 && value != null) { try { // TODO GH: Do i want to use this Zql library for parsing? doesn't seme to work // on first inspection Zql.ZqlParser p = new Zql.ZqlParser(); p.initParser(new ByteArrayInputStream(value.toString().getBytes())); Zql.ZStatement st = p.readStatement(); comp.setToolTipText(st.toString()); // Display the statement } catch(Exception e) { e.printStackTrace(); } } else { comp.setToolTipText((value == null) ? "" : stylize(value.toString())); } TableModel model = table.getModel(); // int realRow = ((TableSorter)model).translateRow(row); // model = ((TableMap)model).getModel(); if (model instanceof StatsTableModel) { if (((StatsTableModel)model).isValueAtChanged(row, column)) { comp.setForeground(Color.red); setFont(getFont().deriveFont(Font.BOLD)); } else { comp.setForeground(Color.black); setFont(getFont().deriveFont(Font.PLAIN)); } } return comp; } } } |
From: Greg H. <gh...@us...> - 2006-04-12 19:14:03
|
Update of /cvsroot/mc4j/mc4j/application/branding/bundle/org/netbeans/core/ui/resources In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20162/application/branding/bundle/org/netbeans/core/ui/resources Added Files: Standard.xml Log Message: Merging EMS into head for the 2.0 release work --- NEW FILE: Standard.xml --- <?xml version="1.0"?> <!-- Sun Public License Notice The contents of this file are subject to the Sun Public License Version 1.0 (the "License"). You may not use this file except in compliance with the License. A copy of the License is available at http://www.sun.com/ The Original Code is NetBeans. The Initial Developer of the Original Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun Microsystems, Inc. All Rights Reserved. --> <!DOCTYPE Configuration PUBLIC "-//NetBeans IDE//DTD toolbar//EN" "http://www.netbeans.org/dtds/toolbar.dtd"> <Configuration> <Row> <Toolbar name="File" visible="true"/> <Toolbar name="Edit" /> <Toolbar name="Build" visible="false" /> <Toolbar name="Debug" visible="false" /> <Toolbar name="Memory"/> <Toolbar name="Versioning" visible="false" /> </Row> <Row> <Toolbar name="WorkspaceSwitcher" visible="true" /> <Toolbar name="StatusLine" visible="true" /> </Row> </Configuration> |
From: Greg H. <gh...@us...> - 2006-04-12 19:14:02
|
Update of /cvsroot/mc4j/mc4j/dist In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20162/dist Removed Files: module_manifest.mf manifest.mf ide.policy Log Message: Merging EMS into head for the 2.0 release work --- manifest.mf DELETED --- --- module_manifest.mf DELETED --- --- ide.policy DELETED --- |