Return-Path: Delivered-To: apmail-logging-general-archive@www.apache.org Received: (qmail 79516 invoked from network); 10 Sep 2008 05:56:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 10 Sep 2008 05:56:00 -0000 Received: (qmail 20219 invoked by uid 500); 10 Sep 2008 05:55:57 -0000 Delivered-To: apmail-logging-general-archive@logging.apache.org Received: (qmail 20180 invoked by uid 500); 10 Sep 2008 05:55:57 -0000 Mailing-List: contact general-help@logging.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: "Logging General" List-Id: Delivered-To: mailing list general@logging.apache.org Received: (qmail 20169 invoked by uid 99); 10 Sep 2008 05:55:57 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Sep 2008 22:55:57 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Sep 2008 05:55:08 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id B3BD32388986; Tue, 9 Sep 2008 22:55:39 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r693710 - /logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogPanel.java Date: Wed, 10 Sep 2008 05:55:39 -0000 To: general@logging.apache.org From: psmith@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080910055539.B3BD32388986@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: psmith Date: Tue Sep 9 22:55:39 2008 New Revision: 693710 URL: http://svn.apache.org/viewvc?rev=693710&view=rev Log: Slight optimization. Found this with Yourkit, but if the Event Detail View is hidden, this logic is still getting fired... That is, detailPain.isVisible() is true... even though we call setVisible(false) to toggle it. Instead, check the Preference model for the state, and exit early if it's not visible. Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogPanel.java Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogPanel.java URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogPanel.java?rev=693710&r1=693709&r2=693710&view=diff ============================================================================== --- logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogPanel.java (original) +++ logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogPanel.java Tue Sep 9 22:55:39 2008 @@ -222,7 +222,7 @@ private final FilterModel filterModel = new FilterModel(); private final RuleColorizer colorizer = new RuleColorizer(); private final RuleMediator ruleMediator = new RuleMediator(); - private EventDetailLayout detailLayout = new EventDetailLayout(); + private final EventDetailLayout detailLayout = new EventDetailLayout(); private double lastDetailPanelSplitLocation = DEFAULT_DETAIL_SPLIT_LOCATION; private double lastLogTreePanelSplitLocation = DEFAULT_LOG_TREE_SPLIT_LOCATION; @@ -231,7 +231,7 @@ private Rule findRule; private final JPanel findPanel; private JTextField findField; - private int dividerSize; + private final int dividerSize; static final String TABLE_COLUMN_ORDER = "table.columns.order"; static final String TABLE_COLUMN_WIDTHS = "table.columns.widths"; static final String COLUMNS_EXTENSION = ".columns"; @@ -2107,7 +2107,7 @@ */ private void setDetailPaneConversionPattern(String conversionPattern) { String oldPattern = getDetailPaneConversionPattern(); - ((EventDetailLayout) detailLayout).setConversionPattern(conversionPattern); + (detailLayout).setConversionPattern(conversionPattern); firePropertyChange( "detailPaneConversionPattern", oldPattern, getDetailPaneConversionPattern()); @@ -2119,7 +2119,7 @@ * @return conversionPattern layout text */ private String getDetailPaneConversionPattern() { - return ((EventDetailLayout) detailLayout).getConversionPattern(); + return (detailLayout).getConversionPattern(); } /** @@ -2632,10 +2632,12 @@ * Update detail pane */ private void updateDetailPane() { - /* - * Don't bother doing anything if it's not visible - */ - if (!detail.isVisible()) { + /* + * Don't bother doing anything if it's not visible. Note: the isVisible() method on + * Component is not really accurate here because when the button to toggle display of + * the detail pane is triggered it still appears as 'visible' for some reason. + */ + if (!preferenceModel.isDetailPaneVisible()) { return; }