Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (101)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (309)
Collections:
Other Resources:
Source Code for Apache Log4j 1.2.17
Apache Log4j
provides the interface that applications should code to and provides the adapter
components required for implementers to create a logging implementation.
Bytecode (Java 1.4) for Apache Log4j is provided in a JAR file like log4j-1.2.17.jar.
Source Code files for Apache Log4j are provided in both binary packge like log4j-1.2.17.zip and source package like log4j-1.2.17-sources.zip. You can download them at Apache Log4j Website.
You can also browse Source Code files for Apache Log4j 1.2.17 below.
✍: FYIcenter.com
⏎ org/apache/log4j/lf5/viewer/LogFactor5Dialog.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You 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.apache.log4j.lf5.viewer; import java.awt.Component; import java.awt.Container; import java.awt.Dimension; import java.awt.Font; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.Insets; import java.awt.Label; import java.awt.Toolkit; import java.awt.Window; import javax.swing.JDialog; import javax.swing.JFrame; /** * LogFactor5Dialog * * @author Richard Hurst * @author Brad Marlborough */ // Contributed by ThoughtWorks Inc. public abstract class LogFactor5Dialog extends JDialog { //-------------------------------------------------------------------------- // Constants: //-------------------------------------------------------------------------- protected static final Font DISPLAY_FONT = new Font("Arial", Font.BOLD, 12); //-------------------------------------------------------------------------- // Protected Variables: //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- // Private Variables: //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- // Constructors: //-------------------------------------------------------------------------- protected LogFactor5Dialog(JFrame jframe, String message, boolean modal) { super(jframe, message, modal); } //-------------------------------------------------------------------------- // Public Methods: //-------------------------------------------------------------------------- public void show() { pack(); minimumSizeDialog(this, 200, 100); centerWindow(this); super.show(); } //-------------------------------------------------------------------------- // Protected Methods: //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- // Private Methods: //-------------------------------------------------------------------------- protected void centerWindow(Window win) { Dimension screenDim = Toolkit.getDefaultToolkit().getScreenSize(); // If larger than screen, reduce window width or height if (screenDim.width < win.getSize().width) { win.setSize(screenDim.width, win.getSize().height); } if (screenDim.height < win.getSize().height) { win.setSize(win.getSize().width, screenDim.height); } // Center Frame, Dialogue or Window on screen int x = (screenDim.width - win.getSize().width) / 2; int y = (screenDim.height - win.getSize().height) / 2; win.setLocation(x, y); } protected void wrapStringOnPanel(String message, Container container) { GridBagConstraints c = getDefaultConstraints(); c.gridwidth = GridBagConstraints.REMAINDER; // Insets() args are top, left, bottom, right c.insets = new Insets(0, 0, 0, 0); GridBagLayout gbLayout = (GridBagLayout) container.getLayout(); while (message.length() > 0) { int newLineIndex = message.indexOf('\n'); String line; if (newLineIndex >= 0) { line = message.substring(0, newLineIndex); message = message.substring(newLineIndex + 1); } else { line = message; message = ""; } Label label = new Label(line); label.setFont(DISPLAY_FONT); gbLayout.setConstraints(label, c); container.add(label); } } protected GridBagConstraints getDefaultConstraints() { GridBagConstraints constraints = new GridBagConstraints(); constraints.weightx = 1.0; constraints.weighty = 1.0; constraints.gridheight = 1; // One row high // Insets() args are top, left, bottom, right constraints.insets = new Insets(4, 4, 4, 4); // fill of NONE means do not change size constraints.fill = GridBagConstraints.NONE; // WEST means align left constraints.anchor = GridBagConstraints.WEST; return constraints; } protected void minimumSizeDialog(Component component, int minWidth, int minHeight) { // set the min width if (component.getSize().width < minWidth) component.setSize(minWidth, component.getSize().height); // set the min height if (component.getSize().height < minHeight) component.setSize(component.getSize().width, minHeight); } //-------------------------------------------------------------------------- // Nested Top-Level Classes or Interfaces //-------------------------------------------------------------------------- }
⏎ org/apache/log4j/lf5/viewer/LogFactor5Dialog.java
Or download all of them as a single archive file:
File name: log4j-1.2.17-sources.jar File size: 481200 bytes Release date: 2012-05-06 Download
⇒ Download and Install apache-log4j-1.2.15.zip
⇐ Download and Install log4j-1.2.17.zip
2015-12-14, 51357👍, 0💬
Popular Posts:
Commons Pool provides an Object-pooling API, with three major aspects: 1. A generic object pool inte...
What Is mail.jar of JavaMail 1.3? I got the JAR file from javamail-1_3.zip. mail.jar in javamail-1_3...
Java Cryptography Extension 1.6 JAR File Size and Download Location: File name: jce.jar, jce-1.6.jar...
maven-compat-3.8.6.jar is the JAR file for Apache Maven 3.8.6 Compact module. The JAR file name may ...
JDK 11 java.sql.jmod is the JMOD file for JDK 11 SQL (Structured Query Language) module. JDK 11 SQL ...