This is an automated email from the ASF dual-hosted git repository. geertjan pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/netbeans.git
The following commit(s) were added to refs/heads/master by this push: new ec35815 NETBEANS-3020 Cleanup Welcome screen (#1457) ec35815 is described below commit ec35815913e5bf8d034b5d7215a32ce50d578734 Author: Geertjan Wielenga <geertjan.wiele...@oracle.com> AuthorDate: Wed Sep 4 13:27:51 2019 +0200 NETBEANS-3020 Cleanup Welcome screen (#1457) * NETBEANS-3020 Cleanup Welcome screen * NETBEANS-3020 Changing Take a Tour link to point to netbeans.apache.org * NETBEANS-3020 Changing All Documentation link to point to netbeans.apache.org * NETBEANS-3020 Changing learning trail links to netbeans.apache.org * NETBEANS-3020 Changing logo link to netbeans.apache.org * NETBEAS-3020 Decrease dependencies on external URLs by excluding the Featured Demo * NETBEANS-3020 Deleting URLs that are no longer used * NETBEANS-3020 Removing references to removed URLs * The main tutorial page is better than homepage. * NETBEANS-3020 Remove incubator logo bar * NETBEANS-3020 Removing ArticlesAndNews tab and its references * NETBEANS-3020 Removing DemoPanel tab and its references * NETBEANS-3020 Removing DemoPanel tab and its references * NETBEANS-3020 Removing DemoPanel tab and its references * NETBEANS-3020 Not pointing to docs page, which is not ready, but to homepage --- .../modules/welcome/resources/Bundle.properties | 18 +- .../netbeans/modules/welcome/resources/layer.xml | 16 - .../netbeans/modules/welcome/resources/tour.url | 2 +- .../modules/welcome/resources/tutorial1-1.url | 1 - .../modules/welcome/resources/tutorial1.url | 2 +- .../modules/welcome/resources/tutorial2.url | 1 - .../modules/welcome/resources/tutorial3.url | 1 - .../modules/welcome/resources/tutorial4.url | 2 +- .../modules/welcome/resources/tutorial5.url | 1 - .../modules/welcome/ui/ArticlesAndNews.java | 99 ------- .../org/netbeans/modules/welcome/ui/BottomBar.java | 2 - .../org/netbeans/modules/welcome/ui/DemoPanel.java | 328 --------------------- .../modules/welcome/ui/LearnAndDiscoverTab.java | 3 - .../netbeans/modules/welcome/ui/WhatsNewTab.java | 3 - 14 files changed, 8 insertions(+), 471 deletions(-) diff --git a/nb/welcome/src/org/netbeans/modules/welcome/resources/Bundle.properties b/nb/welcome/src/org/netbeans/modules/welcome/resources/Bundle.properties index 415ea31..0049517 100644 --- a/nb/welcome/src/org/netbeans/modules/welcome/resources/Bundle.properties +++ b/nb/welcome/src/org/netbeans/modules/welcome/resources/Bundle.properties @@ -27,11 +27,7 @@ WelcomePage/GettingStartedLinks/tour.url=Take a Tour WelcomePage/GettingStartedLinks/sampleproject.instance=Try a Sample Project WelcomePage/TutorialsLinks/tutorial1.url=Java SE Applications -WelcomePage/TutorialsLinks/tutorial1-1.url=Java and JavaFX GUI Applications -WelcomePage/TutorialsLinks/tutorial2.url=Java EE & Java Web Applications -WelcomePage/TutorialsLinks/tutorial3.url=C/C++ Applications WelcomePage/TutorialsLinks/tutorial4.url=PHP and HTML5 Applications -WelcomePage/TutorialsLinks/tutorial5.url=Mobile and Embedded Applications LBL_MoreTutorials=More Demos and Tutorials >> @@ -48,10 +44,6 @@ LBL_Blogs=Blogs #NOI18N URL_Blogs=https://blogs.apache.org/netbeans/feed/entries/atom -LBL_ArticlesAndNews=News & Tutorials -#NOI18N -URL_ArticlesAndNews=http://www.netbeans.org/mtmo.xml - #NOI18N URL_News=http://www.netbeans.org/news.xml @@ -64,11 +56,11 @@ ACD_AllNews=Open the list of all news articles in the default web browser LBL_AllArticles=All Tutorials >> #NOI18N -URL_AllArticles=http://netbeans.org/kb/kb.html?utm_source=netbeans&utm_campaign=welcomepage +URL_AllArticles=https://netbeans.apache.org/help/index.html ACN_AllArticles=Show all tutorials ACD_AllArticles=Open the list of all tutorials in the default web browser -LBL_AllBlogs=All Blogs >> +LBL_AllBlogs=All News >> #NOI18N URL_AllBlogs=https://blogs.apache.org/netbeans/ ACN_AllBlogs=Show all blogs @@ -76,7 +68,7 @@ ACD_AllBlogs=Open the list of all blogs in the default web browser LBL_AllOnlineDocs=All Online Documentation >> #NOI18N -URL_AllOnlineDocs=http://netbeans.org/kb?utm_source=netbeans&utm_campaign=welcomepage +URL_AllOnlineDocs=https://netbeans.apache.org/help/index.html ACN_AllOnlineDocs=Show all online documentation ACD_AllOnlineDocs=Open the list of all documentation in the default web browser @@ -97,7 +89,7 @@ URL_IncubatorLogo=http://incubator.apache.org #NOI18N URL_ApacheLogo=http://www.apache.org #NOI18N -URL_NetBeansLogo=https://netbeans.apache.org?utm_source=netbeans&utm_campaign=welcomepage +URL_NetBeansLogo=https://netbeans.apache.org/ LBL_ContentLoading=Content is loading... LBL_ErrLoadingFeed=Error while loading content @@ -115,7 +107,7 @@ LBL_WelcomeToNetBeans=Welcome to NetBeans IDE #Recent Projects LBL_SectionRecentProjects=Recent Projects #Blogs -LBL_SectionBlogs=Blogs +LBL_SectionBlogs=News #Featured Demo LBL_SectionDemo=Featured Demo #News & Tutorials diff --git a/nb/welcome/src/org/netbeans/modules/welcome/resources/layer.xml b/nb/welcome/src/org/netbeans/modules/welcome/resources/layer.xml index 8e3cd31..d874474 100644 --- a/nb/welcome/src/org/netbeans/modules/welcome/resources/layer.xml +++ b/nb/welcome/src/org/netbeans/modules/welcome/resources/layer.xml @@ -65,26 +65,10 @@ <attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.welcome.resources.Bundle"/> <attr name="position" intvalue="100"/> </file> - <file name="tutorial1-1.url" url="nbresloc:/org/netbeans/modules/welcome/resources/tutorial1-1.url"> - <attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.welcome.resources.Bundle"/> - <attr name="position" intvalue="110"/> - </file> - <file name="tutorial2.url" url="nbresloc:/org/netbeans/modules/welcome/resources/tutorial2.url"> - <attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.welcome.resources.Bundle"/> - <attr name="position" intvalue="200"/> - </file> - <file name="tutorial3.url" url="nbresloc:/org/netbeans/modules/welcome/resources/tutorial3.url"> - <attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.welcome.resources.Bundle"/> - <attr name="position" intvalue="300"/> - </file> <file name="tutorial4.url" url="nbresloc:/org/netbeans/modules/welcome/resources/tutorial4.url"> <attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.welcome.resources.Bundle"/> <attr name="position" intvalue="400"/> </file> - <file name="tutorial5.url" url="nbresloc:/org/netbeans/modules/welcome/resources/tutorial5.url"> - <attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.welcome.resources.Bundle"/> - <attr name="position" intvalue="500"/> - </file> </folder> </folder> diff --git a/nb/welcome/src/org/netbeans/modules/welcome/resources/tour.url b/nb/welcome/src/org/netbeans/modules/welcome/resources/tour.url index 9c4034e..7ef6d8a 100644 --- a/nb/welcome/src/org/netbeans/modules/welcome/resources/tour.url +++ b/nb/welcome/src/org/netbeans/modules/welcome/resources/tour.url @@ -1 +1 @@ -http://netbeans.org/kb/docs/intro-screencasts.html?utm_source=netbeans&utm_campaign=welcomepage \ No newline at end of file +https://netbeans.apache.org/ diff --git a/nb/welcome/src/org/netbeans/modules/welcome/resources/tutorial1-1.url b/nb/welcome/src/org/netbeans/modules/welcome/resources/tutorial1-1.url deleted file mode 100644 index c8a29ff..0000000 --- a/nb/welcome/src/org/netbeans/modules/welcome/resources/tutorial1-1.url +++ /dev/null @@ -1 +0,0 @@ -http://netbeans.org/kb/trails/matisse.html?utm_source=netbeans&utm_campaign=welcomepage diff --git a/nb/welcome/src/org/netbeans/modules/welcome/resources/tutorial1.url b/nb/welcome/src/org/netbeans/modules/welcome/resources/tutorial1.url index 160fa0e..f24e0ff 100644 --- a/nb/welcome/src/org/netbeans/modules/welcome/resources/tutorial1.url +++ b/nb/welcome/src/org/netbeans/modules/welcome/resources/tutorial1.url @@ -1 +1 @@ -http://netbeans.org/kb/trails/java-se.html?utm_source=netbeans&utm_campaign=welcomepage +https://netbeans.apache.org/kb/docs/java/index.html \ No newline at end of file diff --git a/nb/welcome/src/org/netbeans/modules/welcome/resources/tutorial2.url b/nb/welcome/src/org/netbeans/modules/welcome/resources/tutorial2.url deleted file mode 100644 index 7391bd1..0000000 --- a/nb/welcome/src/org/netbeans/modules/welcome/resources/tutorial2.url +++ /dev/null @@ -1 +0,0 @@ -http://netbeans.org/kb/trails/java-ee.html?utm_source=netbeans&utm_campaign=welcomepage \ No newline at end of file diff --git a/nb/welcome/src/org/netbeans/modules/welcome/resources/tutorial3.url b/nb/welcome/src/org/netbeans/modules/welcome/resources/tutorial3.url deleted file mode 100644 index 8ef5d74..0000000 --- a/nb/welcome/src/org/netbeans/modules/welcome/resources/tutorial3.url +++ /dev/null @@ -1 +0,0 @@ -http://netbeans.org/kb/trails/cnd.html?utm_source=netbeans&utm_campaign=welcomepage \ No newline at end of file diff --git a/nb/welcome/src/org/netbeans/modules/welcome/resources/tutorial4.url b/nb/welcome/src/org/netbeans/modules/welcome/resources/tutorial4.url index 602b2bd..d1c2fb7 100644 --- a/nb/welcome/src/org/netbeans/modules/welcome/resources/tutorial4.url +++ b/nb/welcome/src/org/netbeans/modules/welcome/resources/tutorial4.url @@ -1 +1 @@ -http://netbeans.org/kb/trails/php.html?utm_source=netbeans&utm_campaign=welcomepage \ No newline at end of file +https://netbeans.apache.org/kb/docs/php/index.html \ No newline at end of file diff --git a/nb/welcome/src/org/netbeans/modules/welcome/resources/tutorial5.url b/nb/welcome/src/org/netbeans/modules/welcome/resources/tutorial5.url deleted file mode 100644 index 3ebc88a..0000000 --- a/nb/welcome/src/org/netbeans/modules/welcome/resources/tutorial5.url +++ /dev/null @@ -1 +0,0 @@ -http://netbeans.org/kb/trails/mobility.html?utm_source=netbeans&utm_campaign=welcomepage \ No newline at end of file diff --git a/nb/welcome/src/org/netbeans/modules/welcome/ui/ArticlesAndNews.java b/nb/welcome/src/org/netbeans/modules/welcome/ui/ArticlesAndNews.java deleted file mode 100644 index e8095e9..0000000 --- a/nb/welcome/src/org/netbeans/modules/welcome/ui/ArticlesAndNews.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * 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.netbeans.modules.welcome.ui; - -import java.awt.BorderLayout; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Insets; -import java.util.prefs.Preferences; -import javax.swing.JComponent; -import javax.swing.JLabel; -import javax.swing.JPanel; -import org.netbeans.modules.welcome.content.BundleSupport; -import org.netbeans.modules.welcome.content.CombinationRSSFeed; -import org.netbeans.modules.welcome.content.RSSFeed; -import org.netbeans.modules.welcome.content.RSSFeedReaderPanel; -import org.netbeans.modules.welcome.content.WebLink; -import org.openide.util.NbPreferences; - -/** - * - * @author S. Aubrecht - */ -class ArticlesAndNews extends RSSFeedReaderPanel { - - private RSSFeed feed; - - private static final int MAX_ARTICLES_COUNT = 5; - - public ArticlesAndNews() { - super( "ArticlesAndNews", true ); // NOI18N - add( buildBottomContent(), BorderLayout.SOUTH ); - } - - @Override - protected JComponent buildContent(String url, boolean showProxyButton) { - final Preferences p = NbPreferences.root().node("/org/netbeans/modules/autoupdate"); // NOI18N - if( null != p ) { - String ideId = p.get ("ideIdentity", null); // NOI18N - if( null != ideId && ideId.length() > 0 ) { - if( url.contains("?") ) { // NOI18N - url += "&unique="; // NOI18N - } else { - url += "?unique="; // NOI18N - } - url += ideId; - } - } - feed = new ArticlesAndNewsRSSFeed( url, BundleSupport.getURL("News"), showProxyButton ); // NOI18N - feed.addPropertyChangeListener( RSSFeed.FEED_CONTENT_PROPERTY, this ); - return feed; - } - - protected JComponent buildBottomContent() { - WebLink news = new WebLink("AllNews", true); // NOI18N - BundleSupport.setAccessibilityProperties( news, "AllNews" ); //NOI18N - - WebLink articles = new WebLink( "AllArticles", true); // NOI18N - BundleSupport.setAccessibilityProperties( articles, "AllArticles" ); //NOI18N - - JPanel panel = new JPanel( new GridBagLayout() ); - panel.setOpaque(false); - - panel.add( news, new GridBagConstraints(0,1,1,1,0.0,0.0, - GridBagConstraints.SOUTHWEST,GridBagConstraints.HORIZONTAL, - new Insets(5,0,0,15),0,0) ); - panel.add( new JLabel(), new GridBagConstraints(1,1,1,1,1.0,0.0, - GridBagConstraints.CENTER,GridBagConstraints.HORIZONTAL, - new Insets(5,5,0,0),0,0) ); - panel.add( articles, new GridBagConstraints(2,1,1,1,0.0,0.0, - GridBagConstraints.SOUTHEAST,GridBagConstraints.HORIZONTAL, - new Insets(5,5,0,0),0,0) ); - - return panel; - } - - private class ArticlesAndNewsRSSFeed extends CombinationRSSFeed { - public ArticlesAndNewsRSSFeed( String url1, String url2, boolean showProxyButton ) { - super( url1, url2, showProxyButton, MAX_ARTICLES_COUNT ); - } - } -} diff --git a/nb/welcome/src/org/netbeans/modules/welcome/ui/BottomBar.java b/nb/welcome/src/org/netbeans/modules/welcome/ui/BottomBar.java index fc22502..c4615d1 100644 --- a/nb/welcome/src/org/netbeans/modules/welcome/ui/BottomBar.java +++ b/nb/welcome/src/org/netbeans/modules/welcome/ui/BottomBar.java @@ -45,8 +45,6 @@ class BottomBar extends JPanel { add( new JLabel(), new GridBagConstraints(1,0,1,1,1.0,0.0, GridBagConstraints.CENTER,GridBagConstraints.NONE,new Insets(0,0,0,0),0,0 ) ); - add( Logo.createIncubatorLogo(), new GridBagConstraints(4,0,1,1,0.0,0.0, - GridBagConstraints.EAST,GridBagConstraints.NONE,new Insets(5,5,5,12),0,0 ) ); } } diff --git a/nb/welcome/src/org/netbeans/modules/welcome/ui/DemoPanel.java b/nb/welcome/src/org/netbeans/modules/welcome/ui/DemoPanel.java deleted file mode 100644 index fc78787..0000000 --- a/nb/welcome/src/org/netbeans/modules/welcome/ui/DemoPanel.java +++ /dev/null @@ -1,328 +0,0 @@ -/* - * 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.netbeans.modules.welcome.ui; - -import java.awt.Color; -import java.awt.Component; -import java.awt.Cursor; -import java.awt.Graphics; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Image; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.MouseEvent; -import java.awt.event.MouseListener; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.net.HttpURLConnection; -import java.net.MalformedURLException; -import java.net.URL; -import java.net.URLConnection; -import java.util.logging.Level; -import java.util.logging.Logger; -import javax.swing.BorderFactory; -import javax.swing.Icon; -import javax.swing.ImageIcon; -import javax.swing.JButton; -import javax.swing.JComponent; -import javax.swing.JLabel; -import javax.swing.JPanel; -import javax.swing.JToolTip; -import javax.swing.text.View; -import org.netbeans.modules.welcome.content.BundleSupport; -import org.netbeans.modules.welcome.content.Constants; -import org.netbeans.modules.welcome.content.RSSFeed; -import org.netbeans.modules.welcome.content.RSSFeedReaderPanel; -import org.netbeans.modules.welcome.content.Utils; -import org.netbeans.modules.welcome.content.WebLink; -import org.openide.awt.Mnemonics; -import org.openide.awt.StatusDisplayer; -import org.openide.util.ImageUtilities; - -/** - * - * @author S. Aubrecht - */ -class DemoPanel extends RSSFeedReaderPanel { - - public DemoPanel() { - super( BundleSupport.getURL( "Demo" ) ); //NOI18N - } - - @Override - protected JComponent buildContent(String url, boolean showProxyButton) { - JPanel res = new JPanel( new GridBagLayout() ); - res.setOpaque(false); - - DemoRSSFeed feed = new DemoRSSFeed( url ); - res.add( feed, new GridBagConstraints(0,0,1,1,0.0,0.0 - ,GridBagConstraints.NORTHWEST,GridBagConstraints.BOTH,new Insets(0,0,0,0),0,0) ); - res.add( new JLabel(), new GridBagConstraints(1,1,1,1,1.0,1.0, - GridBagConstraints.CENTER,GridBagConstraints.NONE,new Insets(0,0,0,0),0,0) ); - - return res; - } - - class DemoRSSFeed extends RSSFeed { - public DemoRSSFeed( String url ) { - super( url, false ); - } - - @Override - protected Component createFeedItemComponent(FeedItem item) { - JPanel panel = new JPanel( new GridBagLayout() ); - panel.setOpaque(false); - int row = 0; - - if( item.isValid() ) { - if( item.enclosureUrl != null ) { - panel.add( new ImageLabel( item.link, getImage( item.enclosureUrl ), item.description ), - new GridBagConstraints(0,row++,1,1,0.0,0.0, - GridBagConstraints.WEST,GridBagConstraints.NONE, - new Insets(0,0,5,5),0,0 ) ); - } else { - JLabel label = new JLabel( BundleSupport.getLabel("NoScreenShot") ); //NOI18N - label.setHorizontalAlignment( JLabel.CENTER ); - label.setVerticalAlignment( JLabel.CENTER ); - panel.add( label, new GridBagConstraints(0,row++,1,1,0.0,0.0, - GridBagConstraints.CENTER,GridBagConstraints.NONE, - new Insets(0,0,5,5),0,0 ) ); - } - - WebLink linkButton = new WebLink( item.title, item.link, false ); - linkButton.getAccessibleContext().setAccessibleName( - BundleSupport.getAccessibilityName( "WebLink", item.title ) ); //NOI18N - linkButton.getAccessibleContext().setAccessibleDescription( - BundleSupport.getAccessibilityDescription( "WebLink", item.link ) ); //NOI18N - linkButton.setFont( BUTTON_FONT ); - panel.add( linkButton, new GridBagConstraints(0,row++,1,1,0.0,0.0, - GridBagConstraints.WEST,GridBagConstraints.NONE, - new Insets(0,0,5,5),0,0 ) ); - } else { - panel.add( new JLabel(BundleSupport.getLabel("ErrLoadingFeed")), // NOI18N - new GridBagConstraints(0,row++,1,1,0.0,0.0, - GridBagConstraints.CENTER,GridBagConstraints.NONE,new Insets(5,10,10,5),0,0 ) ); - JButton button = new JButton(); - Mnemonics.setLocalizedText( button, BundleSupport.getLabel( "Reload" ) ); // NOI18N - button.setOpaque( false ); - button.addActionListener( new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - lastReload = 0; - reload(); - } - }); - panel.add( button, new GridBagConstraints(0,row++,1,1,0.0,0.0, - GridBagConstraints.CENTER,GridBagConstraints.NONE,new Insets(5,10,10,5),0,0 ) ); - } - - return panel; - } - - @Override - protected int getMaxItemCount() { - return 1; - } - - ImageIcon getImage( String urlString ) { - URL url = null; - try { - url = new URL( urlString ); - } catch( MalformedURLException mfuE ) { - mfuE.printStackTrace(); - } - ImageIcon image = null; - if( isContentCached() ) { - ObjectInputStream input = null; - try { - input = new ObjectInputStream( new FileInputStream( getCacheFilePath() ) ); - image = (ImageIcon)input.readObject(); - Logger.getLogger( DemoPanel.class.getName() ).log( Level.FINE, - "Demo image loaded from: " + getCacheFilePath() ); //NOI18N - }catch( Exception e ) { - image = null; - } finally { - if( null != input ) - try { input.close(); } catch( IOException e ) {} - } - } - - if( null == image ) { - ObjectOutputStream output = null; - try { - URLConnection conn = url.openConnection(); - boolean defCache = conn.getDefaultUseCaches(); - conn.setDefaultUseCaches(true); - if( conn instanceof HttpURLConnection ) { - HttpURLConnection httpConn = ( HttpURLConnection ) conn; - httpConn.connect(); - if( httpConn.getResponseCode() == HttpURLConnection.HTTP_MOVED_TEMP ) { - String newUrl = httpConn.getHeaderField( "Location"); //NOI18N - if( null != newUrl && !newUrl.isEmpty() ) { - return getImage(newUrl ); - } - throw new IOException( "Invalid redirection" ); //NOI18N - } - RSSFeed.initSSL( (HttpURLConnection)conn ); - } - image = new ImageIcon( url ); - conn.setDefaultUseCaches(defCache); - - output = new ObjectOutputStream( new FileOutputStream( getCacheFilePath() ) ); - output.writeObject( image ); - } catch( Exception e ) { - Logger.getLogger( DemoPanel.class.getName() ).log( Level.FINE, - "Error while caching Welcome Page demo image", e ); //NOI18N - image = ImageUtilities.loadImageIcon(Constants.BROKEN_IMAGE, false); - } finally { - if( null != output ) { - try { output.close(); } catch( IOException e ) {} - } - } - } - - return image; - } - - private File getCacheFilePath() throws IOException { - File cacheStore = Utils.getCacheStore(); - cacheStore = new File(cacheStore, "demoimage" ); //NOI18N - cacheStore.getParentFile().mkdirs(); - cacheStore.createNewFile(); - return cacheStore; - } - } - - private static class ImageLabel extends JLabel implements Constants, MouseListener { - private String url; - private boolean visited = false; - - public ImageLabel( String url, ImageIcon img, String description ) { - super( new MaxSizeImageIcon(img.getImage()) ); - this.url = url; - if( null != description ) - setToolTipText( "<html>" + description ); //NOI18N - setOpaque( false ); - setBorder( BorderFactory.createEmptyBorder(1,1,1,1) ); - addMouseListener( this ); - setCursor( Cursor.getPredefinedCursor(Cursor.HAND_CURSOR) ); - } - - @Override - public void mouseClicked(MouseEvent e) { - if( !e.isPopupTrigger() ) { - visited = true; - Utils.showURL( url ); - mouseEntered( null ); - } - } - - @Override - public void mousePressed(MouseEvent e) { - } - - @Override - public void mouseReleased(MouseEvent e) { - } - - @Override - public void mouseEntered(MouseEvent e) { - Color borderColor = visited ? Utils.getVisitedLinkColor() : Utils.getLinkColor(); - setBorder( BorderFactory.createLineBorder(borderColor, 1) ); - StatusDisplayer.getDefault().setStatusText( url ); - } - - @Override - public void mouseExited(MouseEvent e) { - setBorder( BorderFactory.createEmptyBorder(1,1,1,1) ); - StatusDisplayer.getDefault().setStatusText( "" ); - } - - @Override - public JToolTip createToolTip() { - return new MyTooltip(); - } - } - - private static class MaxSizeImageIcon implements Icon, Constants { - private static final int MAX_IMAGE_WIDTH = 202; - private static final int MAX_IMAGE_HEIGHT = 142; - private Image content; - private Image frame; - - public MaxSizeImageIcon( Image content ) { - this.content = content; - frame = ImageUtilities.loadImage( IMAGE_PICTURE_FRAME ); - } - - @Override - public void paintIcon(Component c, Graphics g, int x, int y) { - try { - int imgX = x; - int imgY = y; - if( content.getWidth(null) > MAX_IMAGE_WIDTH ) - imgX += (content.getWidth(null) - MAX_IMAGE_WIDTH) / 2; - if( content.getHeight(null) > MAX_IMAGE_HEIGHT ) - imgY += (content.getHeight(null) - MAX_IMAGE_HEIGHT) / 2; - g.drawImage(content, x, y, x+Math.min(MAX_IMAGE_WIDTH, content.getWidth(null)), - y+Math.min(MAX_IMAGE_HEIGHT, content.getHeight(null)), - imgX, imgY, imgX+Math.min(MAX_IMAGE_WIDTH, content.getWidth(null)), - imgY+Math.min(MAX_IMAGE_HEIGHT, content.getHeight(null)), null); - g.drawImage(frame, x, y, c); - } catch( ThreadDeath td ) { - throw td; - } catch( Throwable e ) { - //#135448 - don't let corrupt image downloads break the painting of the whole IDE window - Logger.getLogger(DemoPanel.class.getName()).log(Level.FINE, - "Error while painting demo image.", e); //NOI18N - } - } - - @Override - public int getIconWidth() { - return MAX_IMAGE_WIDTH; - } - - @Override - public int getIconHeight() { - return MAX_IMAGE_HEIGHT; - } - } - - private static class MyTooltip extends JToolTip { - - @Override - public void setTipText(String tipText) { - super.setTipText(tipText); - if( getPreferredSize().width > 400 ) { - View v = (View) getClientProperty("html"); //NOI18N - if( null != v ) - v.setSize(300.0f, 300.0f); - } - } - - } -} diff --git a/nb/welcome/src/org/netbeans/modules/welcome/ui/LearnAndDiscoverTab.java b/nb/welcome/src/org/netbeans/modules/welcome/ui/LearnAndDiscoverTab.java index c28659f..ca3ed63 100644 --- a/nb/welcome/src/org/netbeans/modules/welcome/ui/LearnAndDiscoverTab.java +++ b/nb/welcome/src/org/netbeans/modules/welcome/ui/LearnAndDiscoverTab.java @@ -44,9 +44,6 @@ class LearnAndDiscoverTab extends AbstractTab { panel.add( new ContentSection( BundleSupport.getLabel("SectionDemosAndTutorials"), new Tutorials(), false )); //NOI18N - panel.add( new ContentSection( BundleSupport.getLabel( "SectionDemo" ), //NOI18N - new DemoPanel(), false )); - return panel; } } diff --git a/nb/welcome/src/org/netbeans/modules/welcome/ui/WhatsNewTab.java b/nb/welcome/src/org/netbeans/modules/welcome/ui/WhatsNewTab.java index 12a36ac..2e077be 100644 --- a/nb/welcome/src/org/netbeans/modules/welcome/ui/WhatsNewTab.java +++ b/nb/welcome/src/org/netbeans/modules/welcome/ui/WhatsNewTab.java @@ -42,9 +42,6 @@ class WhatsNewTab extends AbstractTab { main.setOpaque(false); main.setBorder(BorderFactory.createEmptyBorder()); - main.add( new ContentSection( BundleSupport.getLabel( "SectionNewsAndTutorials" ), //NOI18N - new ArticlesAndNews(), true )); - main.add( new ContentSection( BundleSupport.getLabel( "SectionBlogs" ), //NOI18N new Blogs(), true ) ); --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org For additional commands, e-mail: commits-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists